REM calculator
CLS
100 PRINT
CLS
PRINT "Multi-purpouse calculator"
PRINT
PRINT "(1) addition"
PRINT "(2) subtraction"
PRINT "(3) multiplication"
PRINT "(4) division"
PRINT "(5) square root"
PRINT "(6) exponents (powers)"
PRINT "(7) percentage, rate, and base"
PRINT "(8) commission"
PRINT "(9) pi times a number"
PRINT "(10) sin(number)"
PRINT "(11) cos(number)"
PRINT "(12) tan(number)"
DIM choice
INPUT choice
IF choice > 12 THEN PRINT "invalid number"
IF choice > 12 THEN GOTO 100
32 IF choice = 1 THEN PRINT
IF choice = 1 THEN DIM m1, m2
IF choice = 1 THEN PRINT "Please enter the first addend"
IF choice = 1 THEN PRINT
IF choice = 1 THEN INPUT m1
IF choice = 1 THEN PRINT
IF choice = 1 THEN PRINT "Please enter the second addend"
IF choice = 1 THEN INPUT m2
IF choice = 1 THEN PRINT
IF choice = 1 THEN LET a = m1 + m2
IF choice = 1 THEN PRINT "answer:"; a
IF choice = 1 THEN PRINT
IF choice = 1 THEN DIM ans
23 IF choice = 1 THEN PRINT
IF choice = 1 THEN PRINT "(1) exit the program"
IF choice = 1 THEN PRINT "(2) add more numbers"
IF choice = 1 THEN PRINT "(3) go back to the main menu"
IF choice = 1 THEN DIM addchoice
IF choice = 1 THEN INPUT addchoice
IF choice = 1 AND addchoice > 3 THEN PRINT "invalid number"
IF choice = 1 AND addchoice > 3 THEN GOTO 23
IF choice = 1 AND addchoice = 1 THEN STOP
IF choice = 1 AND addchoice = 2 THEN GOTO 32
IF choice = 1 AND addchoice = 3 THEN GOTO 100
200 IF choice = 2 THEN PRINT
IF choice = 2 THEN DIM s1, s2
IF choice = 2 THEN PRINT "Please enter the minuend"
IF choice = 2 THEN PRINT
IF choice = 2 THEN INPUT s1
IF choice = 2 THEN PRINT
IF choice = 2 THEN PRINT "Please enter the subtrahend"
IF choice = 2 THEN INPUT s2
IF choice = 2 THEN PRINT
IF choice = 2 THEN LET a = s1 - s2
IF choice = 2 THEN PRINT "answer:"; a
IF choice = 2 THEN PRINT
IF choice = 2 THEN DIM ansub
201 IF choice = 2 THEN PRINT
IF choice = 2 THEN PRINT "(1) exit the program"
IF choice = 2 THEN PRINT "(2) subtract more numbers"
IF choice = 2 THEN PRINT "(3) go back to the main menu"
IF choice = 2 THEN DIM subtractchoice
IF choice = 2 THEN INPUT subtractchoice
IF choice = 2 AND subtractchoice > 3 THEN PRINT "invalid number"
IF choice = 2 AND subtractchoice > 3 THEN GOTO 201
IF choice = 2 AND subtractchoice = 1 THEN STOP
IF choice = 2 AND subtractchoice = 2 THEN GOTO 200
IF choice = 2 AND subtractchoice = 3 THEN GOTO 100
300 IF choice = 3 THEN PRINT
IF choice = 3 THEN DIM mu1, mu2
IF choice = 3 THEN PRINT "Please enter the first factor"
IF choice = 3 THEN PRINT
IF choice = 3 THEN INPUT mu1
IF choice = 3 THEN PRINT
IF choice = 3 THEN PRINT "Please enter the second factor"
IF choice = 3 THEN INPUT mu2
IF choice = 3 THEN PRINT
IF choice = 3 THEN LET a = mu1 * mu2
IF choice = 3 THEN PRINT "answer:"; a
IF choice = 3 THEN PRINT
IF choice = 3 THEN PRINT
301 IF choice = 3 THEN PRINT
IF choice = 3 THEN PRINT "(1) exit the program"
IF choice = 3 THEN PRINT "(2) mutliply more numbers"
IF choice = 3 THEN PRINT "(3) go back to the main menu"
IF choice = 3 THEN DIM multchoice
IF choice = 3 THEN INPUT multchoice
IF choice = 3 AND multchoice > 3 THEN PRINT "invalid number"
IF choice = 3 AND multchoice > 3 THEN GOTO 301
IF choice = 3 AND multchoice = 1 THEN STOP
IF choice = 3 AND multchoice = 2 THEN GOTO 300
IF choice = 3 AND multchoice = 3 THEN GOTO 100
400 IF choice = 3 THEN PRINT
IF choice = 4 THEN PRINT
IF choice = 4 THEN DIM div1, div2
IF choice = 4 THEN PRINT "Please enter the numerator"
IF choice = 4 THEN PRINT
IF choice = 4 THEN INPUT div1
IF choice = 4 THEN PRINT
IF choice = 4 THEN PRINT "Please enter the denominator"
IF choice = 4 THEN INPUT div2
IF choice = 4 THEN PRINT
IF choice = 4 THEN LET a = div1 / div2
IF choice = 4 THEN PRINT "answer:"; a
IF choice = 4 THEN PRINT
IF choice = 4 THEN PRINT
401 IF choice = 3 THEN PRINT
IF choice = 4 THEN PRINT "(1) exit the program"
IF choice = 4 THEN PRINT "(2) divide more numbers"
IF choice = 4 THEN PRINT "(3) go back to the main menu"
IF choice = 4 THEN DIM divchoice
IF choice = 4 THEN INPUT divchoice
IF choice = 4 AND divchoice > 3 THEN PRINT "invalid number"
IF choice = 4 AND divchoice > 3 THEN GOTO 401
IF choice = 4 AND divchoice = 1 THEN STOP
IF choice = 4 AND divchoice = 2 THEN GOTO 400
IF choice = 4 AND divchoice = 3 THEN GOTO 100
IF choice = 4 THEN PRINT
500 IF chioce = 5 THEN PRINT
IF choice = 5 THEN DIM sq1
IF choice = 5 THEN PRINT "Please enter your number."
IF choice = 5 THEN INPUT sq1
IF choice = 5 THEN PRINT
IF choice = 5 THEN LET a = SQR(sq1)
IF choice = 5 THEN PRINT "answer:"; a
IF choice = 5 THEN PRINT
501 IF choice = 5 THEN PRINT
IF choice = 5 THEN PRINT "(1) exit the program"
IF choice = 5 THEN PRINT "(2) calculate more square roots"
IF choice = 5 THEN PRINT "(3) go back to the main menu"
IF choice = 5 THEN DIM sqrchoice
IF choice = 5 THEN INPUT sqrchoice
IF choice = 5 AND sqrchoice > 3 THEN PRINT "invalid number"
IF choice = 5 AND sqrchoice > 3 THEN GOTO 501
IF choice = 5 AND sqrchoice = 1 THEN STOP
IF choice = 5 AND sqrchoice = 2 THEN GOTO 500
IF choice = 5 AND sqrchoice = 3 THEN GOTO 100
600 IF choice = 6 THEN PRINT
IF choice = 6 THEN DIM pow1
IF choice = 6 THEN PRINT "Please enter the number to be raised"
IF choice = 6 THEN PRINT
IF choice = 6 THEN INPUT pow1
IF choice = 6 THEN PRINT
IF choice = 6 THEN PRINT "Please enter the power (exponent) you want the number to be raised to"
IF choice = 6 THEN INPUT pow2
IF choice = 6 THEN PRINT
IF choice = 6 THEN LET a = pow1 ^ pow2
IF choice = 6 THEN PRINT "answer:"; a
IF choice = 6 THEN PRINT
601 IF choice = 6 THEN PRINT
IF choice = 6 THEN PRINT "(1) exit the program"
IF choice = 6 THEN PRINT "(2) calculate more"
IF choice = 6 THEN PRINT "(3) go back to the main menu"
IF choice = 6 THEN DIM powchoice
IF choice = 6 THEN INPUT powchoice
IF choice = 6 AND powchoice > 3 THEN PRINT "invalid number"
IF choice = 6 AND powchoice > 3 THEN GOTO 601
IF choice = 6 AND powchoice = 1 THEN STOP
IF choice = 6 AND powchoice = 2 THEN GOTO 600
IF choice = 6 AND powchoice = 3 THEN GOTO 100
897 IF choice = 7 THEN PRINT
IF choice = 7 THEN PRINT
IF choice = 7 THEN PRINT "(1) find percentage when rate and base are known"
IF choice = 7 THEN PRINT "(2) find rate when base and percentage are known"
IF choice = 7 THEN PRINT "(3) find base when percentage and rate are known"
IF choice = 7 THEN DIM prb
IF choice = 7 THEN INPUT prb
IF choice = 7 AND prb > 3 THEN PRINT "Not a valid choice"
IF choice = 7 AND prb > 3 THEN GOTO 100
IF choice = 7 THEN DIM p, r, b
IF choice = 7 AND prb = 1 THEN PRINT "enter base please"
IF choice = 7 AND prb = 1 THEN INPUT b
IF choice = 7 AND prb = 1 THEN PRINT "please enter rate excluding % or decimal (added automatically)"
IF choice = 7 AND prb = 1 THEN PRINT "e.g. for 5% print 5"
IF choice = 7 AND prb = 1 THEN INPUT r
IF choice = 7 AND prb = 1 THEN LET r = r / 100
IF choice = 7 AND prb = 1 THEN LET x = b * r
IF choice = 7 AND prb = 1 THEN PRINT "your answer is"; x
IF choice = 7 AND prb = 2 THEN PRINT "enter base please"
IF choice = 7 AND prb = 2 THEN INPUT b
IF choice = 7 AND prb = 2 THEN PRINT "please enter percentage"
IF choice = 7 AND prb = 2 THEN INPUT p
IF choice = 7 AND prb = 2 THEN LET y = p / b
IF choice = 7 AND prb = 2 THEN LET y = y * 100
IF choice = 7 AND prb = 2 THEN PRINT "your answer is"; y; "%"
IF choice = 7 AND prb = 3 THEN PRINT "please enter rate excluding % or decimal (added automatically)"
IF choice = 7 AND prb = 3 THEN PRINT "e.g. for 5% print 5"
IF choice = 7 AND prb = 3 THEN INPUT r
IF choice = 7 AND prb = 3 THEN PRINT
IF choice = 7 AND prb = 3 THEN PRINT "please enter percentage"
IF choice = 7 AND prb = 3 THEN INPUT p
IF choice = 7 AND prb = 3 THEN LET r = r / 100
IF choice = 7 AND prb = 3 THEN LET z = p / r
IF choice = 7 AND prb = 3 THEN PRINT "Your answer is"; z
896 IF choice = 7 THEN PRINT
IF choice = 7 THEN PRINT "(1) exit the program"
IF choice = 7 THEN PRINT "(2) calculate more percentage-rate-base"
IF choice = 7 THEN PRINT "(3) go back to the main menu"
IF choice = 7 THEN DIM prbchoice
IF choice = 7 THEN INPUT prbchoice
IF choice = 7 AND prbchoice > 3 THEN PRINT "invalid number"
IF choice = 7 AND prbchoice > 3 THEN GOTO 896
IF choice = 7 AND prbchoice = 1 THEN STOP
IF choice = 7 AND prbchoice = 2 THEN GOTO 897
IF choice = 7 AND prbchoice = 3 THEN GOTO 100
111 IF choice = 8 THEN PRINT
IF choice = 8 THEN DIM rate, sales
IF choice = 8 THEN PRINT "please enter the sale amount first."
IF choice = 8 THEN INPUT sales
IF choice = 8 THEN PRINT "Thank you. Now please enter the commision rate NOT INCLUDING the percent sign"
IF choice = 8 THEN INPUT rate
IF choice = 8 THEN LET r = rate / 100
IF choice = 8 THEN LET a = r * sales
IF choice = 8 THEN PRINT
IF choice = 8 THEN PRINT "Great, i got your commision. You should recieve:"
IF choice = 8 THEN PRINT a
112 IF choice = 8 THEN PRINT
IF choice = 8 THEN PRINT "(1) exit the program"
IF choice = 8 THEN PRINT "(2) calculate more percentage-rate-base"
IF choice = 8 THEN PRINT "(3) go back to the main menu"
IF choice = 8 THEN DIM aprbchoice
IF choice = 8 THEN INPUT aprbchoice
IF choice = 8 AND aprbchoice > 3 THEN PRINT "invalid number"
IF choice = 8 AND aprbchoice > 3 THEN GOTO 112
IF choice = 8 AND aprbchoice = 1 THEN STOP
IF choice = 8 AND aprbchoice = 2 THEN GOTO 111
IF choice = 8 AND aprbchoice = 3 THEN GOTO 100
114 IF choice = 9 THEN PRINT "please enter the value that you want pi to be multiplied by"
IF choice = 9 THEN DIM q
IF choice = 9 THEN INPUT q
IF choice = 9 THEN LET p = q
IF choice = 9 THEN LET a = q * 3.141592653589793238462643
IF choice = 9 THEN PRINT "The answer is"; a
113 IF choice = 9 THEN PRINT
IF choice = 9 THEN PRINT "(1) exit the program"
IF choice = 9 THEN PRINT "(2) do more calculations"
IF choice = 9 THEN PRINT "(3) go back to the main menu"
IF choice = 9 THEN DIM pichoice
IF choice = 9 THEN INPUT pichoice
IF choice = 9 AND pichoice > 3 THEN PRINT "invalid number"
IF choice = 9 AND pichoice > 3 THEN GOTO 113
IF choice = 9 AND pichoice = 1 THEN STOP
IF choice = 9 AND pichoice = 2 THEN GOTO 114
IF choice = 9 AND pichoice = 3 THEN GOTO 100
115 IF choice = 10 THEN PRINT "please enter your number"
IF choice = 10 THEN DIM sintimes
IF choice = 10 THEN INPUT sintimes
IF choice = 10 THEN LET p = sintimes
IF choice = 10 THEN LET a = SIN(sintimes)
IF choice = 10 THEN PRINT "The answer is"; a
116 IF choice = 10 THEN PRINT
IF choice = 10 THEN PRINT "(1) exit the program"
IF choice = 10 THEN PRINT "(2) do more calculations"
IF choice = 10 THEN PRINT "(3) go back to the main menu"
IF choice = 10 THEN DIM fpichoice
IF choice = 10 THEN INPUT fpichoice
IF choice = 10 AND fpichoice > 3 THEN PRINT "invalid number"
IF choice = 10 AND fpichoice > 3 THEN GOTO 116
IF choice = 10 AND fpichoice = 1 THEN STOP
IF choice = 10 AND fpichoice = 2 THEN GOTO 115
IF choice = 10 AND fpichoice = 3 THEN GOTO 100
117 IF choice = 11 THEN PRINT "please enter your number"
IF choice = 11 THEN DIM csintimes
IF choice = 11 THEN INPUT csintimes
IF choice = 11 THEN LET p = csintimes
IF choice = 11 THEN LET a = COS(sintimes)
IF choice = 11 THEN PRINT "The answer is"; a
118 IF choice = 11 THEN PRINT
IF choice = 11 THEN PRINT "(1) exit the program"
IF choice = 11 THEN PRINT "(2) do more calculations"
IF choice = 11 THEN PRINT "(3) go back to the main menu"
IF choice = 11 THEN DIM cfpichoice
IF choice = 11 THEN INPUT cfpichoice
IF choice = 11 AND cfpichoice > 3 THEN PRINT "invalid number"
IF choice = 11 AND cfpichoice > 3 THEN GOTO 118
IF choice = 11 AND cfpichoice = 1 THEN STOP
IF choice = 11 AND cfpichoice = 2 THEN GOTO 117
IF choice = 11 AND cfpichoice = 3 THEN GOTO 100
119 IF choice = 12 THEN PRINT "please enter your number"
IF choice = 12 THEN DIM t
IF choice = 12 THEN INPUT t
IF choice = 12 THEN LET p = t
IF choice = 12 THEN LET a = TAN(t)
121 IF choice = 12 THEN PRINT "Your answer is"; a
IF choice = 12 THEN PRINT "(1) exit the program"
IF choice = 12 THEN PRINT "(2) do more calculations"
IF choice = 12 THEN PRINT "(3) go back to the main menu"
IF choice = 12 THEN DIM tcfpichoice
IF choice = 12 THEN INPUT tcfpichoice
IF choice = 12 AND tcfpichoice > 3 THEN PRINT "invalid number"
IF choice = 12 AND tcfpichoice > 3 THEN GOTO 121
IF choice = 12 AND tcfpichoice = 1 THEN STOP
IF choice = 12 AND tcfpichoice = 2 THEN GOTO 119
IF choice = 12 AND tcfpichoice = 3 THEN GOTO 100
IF choice <> 1 OR 2 OR 3 OR 4 OR 5 OR 6 OR 7 OR 8 OR 9 OR 10 OR 11 OR 12 THEN PRINT "That number was not valid, sorry."
IF choice <> 1 OR 2 OR 3 OR 4 OR 5 OR 6 OR 7 OR 8 OR 9 OR 10 OR 11 OR 12 THEN GOTO 100