To do addition use the +: x + y
to do subtraction use the -: x - y
etc
if(str.equals("+")) // test the string
val = x + y; // do the math operation
else id(str.equals("-"))
...
Type: Posts; User: Norm
To do addition use the +: x + y
to do subtraction use the -: x - y
etc
if(str.equals("+")) // test the string
val = x + y; // do the math operation
else id(str.equals("-"))
...
Use an if statement to test the value of the String to see what it is.
The code will have to have the math operations in it already and use the value of the String to determine which operation to...