I need some java code that will process a single string variable containing a infix mathematical expression, e.g.
and output the answer as a double. The code must be able to handle errors in the string, such as white space and non valid characters, and of course, be able to handle devide by zero!
So far I have built the gui for the calculator and can pass a string into my workOut class, I now need to the clever code for evaluating the string and then working out the answer...
can you help?
source code in a single .java file with comments in source code
Any, it's java ;-)