We'll just make a very simple calculator. It won't work precisely like a real calculator, but it will be close.
First, we have to recognise that a calculator has to deal with more than just the number shown in it's display. For example, if you key "100 + 32", at the moment the "32" is being displayed, the calculator is also keeping track of the "100".
We need to declare a variable that will keep track of the running result.
|