home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / educatin / drill.arc / MADAS.BAS < prev    next >
BASIC Source File  |  1986-08-11  |  1KB  |  30 lines

  1. 100 REM * MADAS.BAS * MENTAL ADDITION/SUBTRACTION PGM USED WITH DRILL.BAS *
  2. 110 CLS:'Use your own clear screen command here.
  3. 120 REM * Seed the random number generator from Time$
  4. 130 A=VAL(MID$(TIME$,4,2)+MID$(TIME$,7,2)):RANDOMIZE A
  5. 140 PRINT TAB(10)"----- Mental Addition/Subtraction -----"
  6. 150 PRINT"This is a program to practice mental addition and subtraction."
  7. 160 PRINT"You will start with a number between 26 and 35.
  8. 170 PRINT"There will be 20 numbers to add or subtract mentally."
  9. 180 INPUT"Press ENTER when you are ready to start";A
  10. 190 T=0
  11. 200 T=INT(RND*9)+25
  12. 210 LOCATE 8,30:PRINT T
  13. 220 FOR Q=1 TO 1500:NEXT Q
  14. 230 FOR X=1 TO 20
  15. 240   Z=INT(RND*3)+1
  16. 250   Y=INT(RND*9)+1
  17. 260   ON Z GOTO 270,270,280
  18. 270   LOCATE 8,30:PRINT "+";Y:T=T+Y:GOTO 290
  19. 280   LOCATE 8,30:PRINT "-";Y:T=T-Y
  20. 290   IF X=20 THEN 330
  21. 300   FOR Q=1 TO 3000:NEXT Q
  22. 310   LOCATE 8,30:PRINT"   "
  23. 320   FOR Y=1 TO 300:NEXT Y
  24. 330 NEXT X
  25. 340 INPUT"What is your answer";AN
  26. 350 IF AN=T THEN PRINT"Great Job!" ELSE PRINT"The correct answer is:";T
  27. 360 PRINT"Do you wish to try again (Y/N)"
  28. 370 A$=INKEY$:IF A$="" THEN 370
  29. 380 IF A$="Y" OR A$="y" THEN 110 ELSE RUN"DRILL.BAS"
  30.