Arduino calculator

Hi,
so there's been a lot of topics similar to this one, but I wasn't able to find solution to my problem.

In the future I want to make a full scientific calculator, of course this will take a long time effort and such, but that's my dream...

Currently, I need to make a good system, that will save the user input. I was thinking of this:
Once the user enters a number, this will be saved in a variable called "num1". Once the user presses + - * or /, next number would get saved to "num2". To add number longer than on digit I put this:

num1 = num1 * 10 + currentNum

Easy.

Then I realised, that the user is not able to input more than 2 numbers to add, multiply or whatever. Is there another way, how to handle to multiple operators, other then making a bazillion variables num1, num2, num3 etc...?

And one more question is there a variable, that you can store numbers and letter together?

Thanks a lot in advance

vaseksim:
Then I realised, that the user is not able to input more than 2 numbers to add, multiply or whatever. Is there another way, how to handle to multiple operators, other then making a bazillion variables num1, num2, num3 etc...?

And one more question is there a variable, that you can store numbers and letter together?

Thanks a lot in advance

Usually the answer to a bazillion variables question is, an array. You can store different datatypes together with a struct.

So basically the calculator I made?

http://playground.arduino.cc/Main/KeypadCalculator

Why would you need to think about more than 2 numbers? On most calculators I’ve used, you input the first number and then an operation and then the second number and at that point you get a result. If you press a key for another operation then that result is the first number and you enter a second number.

IE:

press 1 → num1 is 1

press + → got the operation

press 2 → num2 is 2 result is 3 move 3 to num1.

press - → got a new operation

press 3 → num 2 is three result is now 0 move that to num1 to get ready for next operation.

Which is exactly what my sketch does. The only thing is you still need to press enter per entry. I could add that in, it would only be a few more conditions to check when getting the second value.

I think an enter key is an awfully good idea if you want to use numbers larger than a single digit.

Wasn't thinking about that in my post. But most calculators do have an equal sign key you have to press.

The first value keeps collecting until an operator is pressed then the second does the same until the enter key is pressed. However I can change the code to continuously collect data between operators.

Use reverse Polish notation and the whole thing becomes very easy to program. That is because there is no suspension of operation in that system. That means you don't have to remember the operation while the user puts in the second number. When ever you see an operator key you just do that operation with however many numbers on the stack you need.

I have a calculator that uses RPN. RPN calculator It is delightful to watch someone try to use it who was only familiar with a normal calculator.