First of all there are a variety of way to solve equations like the ones you are quoting.
One idea would be to use a stack to solve your expression.
http://www.spsu.edu/cs/faculty/bbrow...tures/postfix/
http://www.qiksearch.com/articles/cs...ix-evaluation/
Another idea, would be to use a binary tree to solve your expression.
Take for example :Code:2+2*(11-3)
This would be parsed as such in a binary tree:
And evaluated from the bottom upwards. Meaning that a post order traversal of the tree will evaluate the expression correctly.Code:+ / \ * 2 / \ 2 - / \ 11 3
I.e in postfix notation.
http://math.hws.edu/eck/cs225/s03/binary_trees/
If I were you I would seriously consider looking into using either the stack or a binary tree to do this. Ok, these data structures are not trivial but this is probably the only reliable way to obtain accurate calculations.
I've not seen your code, but it sounds as if you have done the same using multiple classes and case conditions. In short this will probably fail at some point in the long run. On the other hand, you mentioned briefly using a linked list, so you may not be too far from a reliable solution.
Good luck