I'm trying to create a simple natural language calculator, and currently have managed to convert all operands into doubles and operators into the chars '+', '-', '*', '/', '%'.
However, I want to evaluate the expression using the correct order of operations, and to that end it would be useful if I could take advantage of Java's natural order of operations when computing expressions. Is there a way to compute this sort of expression that contains character operands? I was thinking that maybe my program could write some sort of temporary java class, compile it and run it to evaluate the expression, but that seems a tad excessive. There must be a simpler way to do it?