I'm making a simple C++ calculator. I want it to work something like this sample run:
10 S // Set Accumulator to 10
= 10.000000 // Contents of Accumulator
2 / // Divide by 2
= 5.000000 // Contents of Accumulator
55 - // Subtract 55
100.25 S // Set Accumulator to 100.25
4 * // Multiply by 4
E // End of Program
End of Calculations
I made methods for all of the actual actions of dividing and multiplying, etc.
I'm more confused about taking in my user's input. Should I take it as a string and parse it? Is there a way for them to input the symbol and number and both would result in a "symbol" variable and a "number" variable, and if it's wrong there is an error?
I'm fairly new to C++ so any help you can give me would be great.