how to solve calculations in java -


i'm working on calculator, should receive input string , perform calculation, outputting result.

for example, input be

  ((23+17) mod 7 × 4 , 13 

and output 4, expected.

how can parse input, extract operands , perform calculation ?

the other answers "how set variable result" if you're looking parse input, should refer this:

equation (expression) parser precedence?

there number of ways go solving kind of problem, , number of algorithms doing so. of them stack based, perform descent of "tree", , can think of (somewhat) convoluted way oop-ize it. start link above.


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -