Currently learning Java, and trying to parse a maths equation for valid inputs:
For example, the user has to input integers in the form:
Operand Operator Operand
in that specific order, and the program would then need to be able to tell if the inputs were in that form, and then work out the simple equation.
An example would be:
4 * 8 which the result would give as 32
the program would also reject something like 45.6 * 0.3, or 45 + 3 / 4
For this to work, do I have to use regular expression, or some other method of if loops?
10.0
? What about1e+02
? Also consider010
and+10
and-10
.