basically i want to create a simple calculator with 0-9 interface, a plus sign,a minus sign , a clear button,an equals sign and a display. the calculator should be able to perform addition and subtraction of integer values. These integer values should be input by pressing the keys on the calculator interface. the system need only to work up to 999.
please help me am very stuck.
Thank you
Offline
OK. I am expert math guy (for a third grader-I don't know what Nil means)
XD
Offline
liban1 wrote:
basically i want to create a simple calculator with 0-9 interface, a plus sign,a minus sign , a clear button,an equals sign and a display.
I will add a x time and division.
Offline
basically i want to create a simple calculator with 0-9 interface, a plus sign,a minus sign , a clear button,an equals sign and a display. the calculator should be able to perform addition and subtraction of integer values. These integer values should be input by pressing the keys on the calculator interface. the system need only to work up to 999.
please help me am very stuck.
Thank you
Offline
I'd use variables.
(Number1)//first number you enter (Number2)//second number you enter (Operation)//Whether you want to add or subtract When gf clicked Set (Number1) to [No Input] Set (Number2) to [No Input] Set (Operation) to [No Input] Set (Sum/Difference) to [no output] Hide variable (Number1) hide variable (Number2) hide variable (Operation) Hise variable (Sum/difference) When [Button1] clicked If <(Number1) = [No Input]> //If nothing's been input yet Set (Number1) to [1] End If <Not <(Number1) = [No Input]>> //If it has an input Set (Number2) to [1] EndDo that for all of the number buttons (and you could do it for the number keys)
When [+] clicked Set [Sum/Difference] to <(Number1) + (Number2)> When [-] clicked Set [Sum/Difference] to <(Number1) - (Number2)>NOTE: I just realized that the way I did that doesn't allow you to do multiple digit numbers. You can make a slight variation to fix that.
Offline