Well, firstly, you want to tokenize the string. In essence, separate each element. Separate operations from individual numbers and save them in something (possibly a list). Then just do the operations based on the order of operations.
Thus, the pseudocode will look something like this:
public int eval(String infix) { create a list of all the elements identify which operations you would want to do first perform the operations and simplify the list (eg if 5x4 were inside parantheses, remove the parantheses and replace it overall with 20.) continue the simplification until you have a final result return the result }
There are probably much better ways to do this, but here is one solution.
Clark source share