'**** math program ****
DECLARE SUB add ()
DECLARE SUB subtract ()
DECLARE SUB multiply ()
DECLARE SUB divide ()
DECLARE SUB geo ()
DECLARE SUB art ()
DECLARE SUB erro ()
DECLARE SUB fin ()
COMMON SHARED e.x
1
x$ = ""
CLS
LOCATE 4, 35: PRINT "Math Menu"
LOCATE 12, 25: PRINT "Add (1)"
LOCATE 15, 25: PRINT "Subtract (2)"
LOCATE 18, 25: PRINT "Multiply (3)"
LOCATE 21, 25: PRINT "Divide (4)"
LOCATE 12, 45: PRINT "Geometric (5)"
LOCATE 15, 45: PRINT "Arthmetic (6)"
LOCATE 18, 45: PRINT "END (7)"
WHILE x$ = ""
x$ = INKEY$
WEND
IF x$ = "1" THEN CALL add: GOTO 1 ELSE
IF x$ = "2" THEN CALL subtract: GOTO 1 ELSE
IF x$ = "3" THEN CALL multiply: GOTO 1 ELSE
IF x$ = "4" THEN CALL divide: GOTO 1 ELSE
IF x$ = "5" THEN CALL geo: GOTO 1 ELSE
IF x$ = "6" THEN CALL art: GOTO 1 ELSE
IF x$ = "7" THEN CALL fin: END ELSE e.x = 1: CALL erro: GOTO 1
SUB add
CLS
LOCATE 4, 35: PRINT "Math Add"
LOCATE 12, 25: PRINT "1st number"
LOCATE 14, 25: PRINT "2nd number"
LOCATE 16, 25: PRINT "Answer"
LOCATE 12, 25: INPUT "1st number ", a.1
LOCATE 14, 25: INPUT "2nd number ", a.2
a.t = a.1 + a.2
LOCATE 16, 32: PRINT a.t
LOCATE 20, 25: INPUT "Press Any Button To Continue", z$
END SUB
SUB art
CLS
LOCATE 4, 35: PRINT "Arthmatic equation"
LOCATE 12, 25: PRINT "First number"
LOCATE 14, 25: PRINT "Term number"
LOCATE 16, 25: PRINT "Ratio"
LOCATE 18, 25: PRINT "Answer"
LOCATE 12, 25: INPUT "First number ", a
LOCATE 14, 25: INPUT "Term number ", t
LOCATE 16, 25: INPUT "Ratio ", r
an = a + r * (t - 1)
LOCATE 18, 31: PRINT an
LOCATE 22, 25: INPUT "Press Any Button To Continue", z
END SUB
SUB divide
CLS
LOCATE 4, 35: PRINT "Math Divide"
LOCATE 12, 25: PRINT "1st number"
LOCATE 14, 25: PRINT "2nd number"
LOCATE 16, 25: PRINT "Answer"
LOCATE 12, 25: INPUT "1st number", d.1
LOCATE 14, 25: INPUT "2nd number", d.2
d.t = d.1 / d.2
LOCATE 16, 31: PRINT d.t
LOCATE 20, 25: INPUT "Press Any Button To Continue", z
END SUB
SUB erro
IF e.x = 1 THEN ELSE GOTO 2
LOCATE 30, 25: PRINT "Invalid Entry"
BEEP
SLEEP 1
2
END SUB
SUB fin
CLS
LOCATE 12, 25: PRINT "Produced by ReconJB"
LOCATE 14, 25: PRINT "additional requests can be posted"
LOCATE 16, 25: PRINT "in the comment section"
LOCATE 18, 25: PRINT "Thanks For Using"
END SUB
SUB geo
CLS
LOCATE 4, 35: PRINT "Math Geometric Equations"
LOCATE 12, 25: PRINT "1st number"
LOCATE 14, 25: PRINT "term number"
LOCATE 16, 25: PRINT "ratio"
LOCATE 18, 25: PRINT "Answer"
LOCATE 12, 25: INPUT "1st number ", g.1
LOCATE 14, 25: INPUT "term number ", t
LOCATE 16, 25: INPUT "ratio ", r
an = g.1 * r ^ (t - 1)
LOCATE 18, 31: PRINT an
LOCATE 22, 25: INPUT "Press Any Button To Continue", z
END SUB
SUB multiply
CLS
LOCATE 3, 35: PRINT "Math Multiply"
LOCATE 12, 25: PRINT "1st number"
LOCATE 14, 25: PRINT "2nd number"
LOCATE 16, 25: PRINT "Answer"
LOCATE 12, 25: INPUT "1st number ", m.1
LOCATE 14, 25: INPUT "2nd number ", m.2
m.t = m.1 * m.2
LOCATE 16, 31: PRINT m.t
LOCATE 20, 25: INPUT "Press Any Button To Continue", z$
END SUB
SUB subtract
CLS
LOCATE 4, 35: PRINT "Math Subtract"
LOCATE 12, 25: PRINT "1st number"
LOCATE 14, 25: PRINT "2nd number"
LOCATE 16, 25: PRINT "Answer"
LOCATE 12, 25: INPUT "1st number ", s.1
LOCATE 14, 25: INPUT "2nd number ", s.2
s.t = s.1 - s.2
LOCATE 16, 31: PRINT s.t
LOCATE 20, 25: INPUT "Press Any Button To Continue", z$
END SUB