10 REM* * * * * * * * * * * * * * * * * *
20 REM*      MATH PROGRAM
30 REM*     APRIL 26, 1981
40 REM* * * * * * * * * * * * * * * * * *
50 REM*
60 PRINT CHR$(26)
70 GOSUB 830
80 PRINT:PRINT:PRINT
90 PRINT "             PICK WHICH KIND OF MATH"
100 PRINT : PRINT 
110 PRINT "                  1. ADDITION"
120 PRINT "                  2. SUBTRACTION"
130 PRINT "                  3. MULTIPLICATION"
140 PRINT "                  4. DIVISION"
150 PRINT:PRINT:PRINT:PRINT
160 INPUT "               TYPE  THE NUMBER: ",Z
170 RANDOMIZE X
180 ON Z GOTO 190,340,500,650
190 REM* * * * * * * * * * * * * * * * * *
200 REM*       ADDITION ROUTINE
210 REM* * * * * * * * * * * * * * * * * *
220 GOSUB 830
230 GOSUB 970
240 PRINT: PRINT: PRINT: PRINT
250 PRINT "                ";X;" + ";Y;" = ";
260 INPUT "",A
270 IF A=X+Y THEN  GOSUB 1030
280 IF A<X+Y THEN  GOSUB 1120
290 IF A>X+Y THEN  GOSUB 1210
300 GOSUB 910
310 IF B=1 THEN INPUT "",Z$:GOTO 190
320 INPUT "",Z$:GOSUB 830
330 GOTO 240
340 REM* * * * * * * * * * * * * * * * * *
350 REM*        SUBTRACTION ROUTINE
360 REM* * * * * * * * * * * * * * * * * *
370 GOSUB 830
380 GOSUB 970
390 PRINT:PRINT:PRINT:PRINT
400 IF Y>X THEN LET Z=X:X=Y:Y=Z
410 PRINT "                 ";X;" - ";Y;" = ";
420 INPUT "",A
430 IF A=X-Y THEN  GOSUB 1030
440 IF A<X-Y THEN  GOSUB 1120
450 IF A>X-Y THEN  GOSUB 1210
460 GOSUB 910
470 IF B=1 THEN INPUT "",Z$:GOTO 340
480 INPUT "",Z$: GOSUB 830
490 GOTO 390
500 REM* * * * * * * * * * * * * * * * * *
510 REM*       MULTIPLICATION ROUTINE
520 REM* * * * * * * * * * * * * * * * * *
530 GOSUB 830
540 GOSUB 970
550 PRINT:PRINT:PRINT:PRINT
560 PRINT "                 ";X;" X ";Y;" = ";
570 INPUT "",A
580 IF A=X*Y THEN  GOSUB 1030
590 IF A<X*Y THEN  GOSUB 1120
600 IF A>X*Y THEN  GOSUB 1210
610 GOSUB 910
620 IF B=1 THEN INPUT "",Z$:GOTO 500
630 INPUT "",Z$: GOSUB 830
640 GOTO 550
650 REM* * * * * * * * * * * * * * * * * *
660 REM*       DIVISION ROUTINE
670 REM* * * * * * * * * * * * * * * * * *
680 GOSUB 830
690 GOSUB 970
700 IF X=0 THEN 690
710 IF Y=0 THEN 690
720 PRINT:PRINT:PRINT:PRINT
730 LET Z=X*Y
740 PRINT "                 ";Z;" / ";X;" = ";
750 INPUT "",A
760 IF A=Z/X THEN  GOSUB 1030
770 IF A<Z/X THEN  GOSUB 1120
780 IF A>Z/X THEN  GOSUB 1210
790 GOSUB 910
800 IF B=1 THEN INPUT "",Z$:GOTO 650
810 INPUT "",Z$: GOSUB 830
820 GOTO 720
830 REM* * * * * * * * * * * * * * * * * *
840 REM*     DISPLAY TITLE
850 REM* * * * * * * * * * * * * * * * * *
860 PRINT CHR$(26);"                 LET'S DO MATH"
870 PRINT "                 RAY GORDON JR."
880 PRINT "               COPYRIGHT (C) 1981"
890 PRINT "               ALL RIGHTS RESERVED"
900 RETURN 
910 REM* * * * * * * * * * * * * * * * * *
920 REM*     DISPLAY SCORE
930 REM* * * * * * * * * * * * * * * * * *
940 PRINT:PRINT:PRINT:PRINT:PRINT:PRINT
950 PRINT "          SCORE:  RIGHT:";R;"   WRONG:";W
960 RETURN
970 REM* * * * * * * * * * * * * * * * * *
980 REM*      GET RANDOM NUMBERS
990 REM* * * * * * * * * * * * * * * * * *
1000 LET X=INT((RND(X))*10)
1010 LET Y=INT((RND)*10)
1020 RETURN
1030 REM* * * * * * * * * * * * * * * * * *
1040 REM*      ANSWER IS CORRECT
1050 REM* * * * * * * * * * * * * * * * * *
1060 LET R=R+1: LET B=1
1070 PRINT:PRINT:PRINT:PRINT:PRINT
1080 PRINT "            RIGHT!  YOU ARE CORRECT!!"
1090 PRINT
1100 PRINT "            TYPE RETURN TO TRY ANOTHER";
1110 RETURN
1120 REM* * * * * * * * * * * * * * * * * *
1130 REM*    INCORRECT, TOO SMALL
1140 REM* * * * * * * * * * * * * * * * * *
1150 LET W=W+1: LET B=0
1160 PRINT:PRINT:PRINT:PRINT:PRINT
1170 PRINT "            YOUR ANSWER IS TOO SMALL."
1180 PRINT
1190 PRINT "          PLEASE TRY AGAIN, TYPE RETURN";
1200 RETURN
1210 REM* * * * * * * * * * * * * * * * * *
1220 REM*       INCORRECT, TOO BIG
1230 REM* * * * * * * * * * * * * * * * * *
1240 LET W=W+1: LET B=0
1250 PRINT:PRINT:PRINT:PRINT:PRINT
1260 PRINT "            YOUR ANSWER IS TOO BIG"
1270 PRINT
1280 PRINT "          PLEASE TRY AGAIN, TYPE RETURN";
1290 RETURN
