At the moment you hit the minus key, the calculator actually adds the 100 and the 32.
If you have a real calculator nearby, try it — you might be surprised !
The first step in coding anything is to have a solid understanding of what needs to be done.
It turns out that when you press an operation button on a calculator, what happens is not that operator, but the one before. Don't believe it? Try it !
So we need to declare a variable that will keep track of the previous operator
|