I'm writing an automatic teller machine program for a course I'm
doing, and I need help with the arithmetic. When the user types in an
amount they wish to deposit or withdraw, I need to add that to or
subtract that from their current balance (a preset amount of $99.00).
When a key is pressed, the CPU will treat that as an individual
figure, and when a second is pressed, that will also be treated as an
individual figure. So for example, if I typed in '50', it would see it
as a 5 and then a 0. I want to combine these two individual figures to
make one number '50'.
From then, I need to add or subtract that to or from the existing
balance. I believe this can be done with BCD, but I'm not confident on
the exact coding. Can anyone help?