Your task is to create an interpreter for a calculator. It has to parse commands like
5 + 5 and return the answer.
It has to be able to add, subtract, multiply, and divide. The interpreter only needs to accept two numbers (ex.
9 * 5 and
3 + 3)
The interpreter will take input from a console/whatever, not a file.
Eval isn't allowed
5 * 5
8 / 2
If you're really bored you can add these to the interpreter, if you'd like:
Simple mathematical functions like
Make the interpreter be able to accept more than two numbers (ex.
55 + 55)