I need some general guidance with the following problem:
1) ask the user to input a mathematical expression in the following format:
NUMBER Operator NUMBER Operator NUMBER
Example: 17 + 15 - 3
Example: 2 * 3 - 4
I am having trouble figuring out how to output the answer of the users equation. Is there a function that includes all math operators (+,-,/,*)? Would i need to write each possible scenario using if statements?
If that is all you doing (number operator number operator number) it won't be too long, and the code coder777 gave you works fine. Make sure you consider operator precedence too.