|
Re: Helping you would be wrong
|
Posted: Oct 2, 2006 2:06 AM
|
|
Identify an expression in prarentheses (you have to count the open ones until you find the correspojnfding closing one), then call your method recursively with this inner expression. Do this until you don't have any prarentheses left. Now all you have are additions, multiplications, ... Find the multiplication operators in your String, execute the operation and replace the operation with the result. Now do the same fir divisions, then for additions and subtractions. If you called your method recursively, then place the result in the String instead of the operation.
|
|