home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / CPMUG / CPMUG037.ARK / DEC2.BAS < prev    next >
BASIC Source File  |  1984-04-29  |  2KB  |  78 lines

  1. %INCLUDE HEADER
  2. REM ***************DEC2
  3.  
  4. DRILL.NAME$="Change Mixed Fractions to Decimals"
  5. REM THIS DRILL CHANGES MIXED FRACTIONS TO DECIMALS
  6.          PRINT
  7.          B=17
  8.          P=9
  9.     D=4
  10.          PRINT
  11.          PRINT "      ";
  12.          GOSUB 740
  13.          PRINT "?"
  14.          PRINT
  15.          PRINT "You must change the fraction to a decimal number and give me"
  16.          PRINT "the answer correct at least to the nearest hundredth."
  17.          PRINT
  18.          PRINT "To solve the sample problem, you should convert the fraction"
  19.          PRINT R;"/";A2;" to the decimal fraction ";A
  20.          PRINT "BY dividing, round the decimal fraction to"
  21.          PRINT "the nearest hundredth, and add it to"
  22.          PRINT q; "to get the correct answer of ";a;"."
  23.          PRINT
  24.          PRINT
  25.          C=0
  26.          I=0
  27.          N=0
  28. 330 GOSUB 740
  29.          GOSUB 840
  30.          IF A$<>"C" THEN GOTO 390
  31. 360 C=C+1
  32.          C=C+1
  33.          I=I+1
  34.          GOTO 470
  35.          I=0
  36. 390 PRINT " TRY AGAIN."
  37.          GOSUB 840
  38.          IF A$="C" THEN GOTO 470
  39. 380 PRINT "  TRY ONE MORE TIME"
  40.          GOSUB 840
  41.          IF A$="C" THEN GOTO 470
  42. 410 PRINT "  THE ANSWER IS  ";A
  43. 470 IF I>P*C/N THEN GOTO 1000.2
  44.          IF N<7 THEN GOTO 330
  45.          IF C/N >= .7 THEN GOTO 330
  46.          IF D=1 THEN GOTO 330
  47.          D=D-1
  48.          IF C/N >= .5 THEN GOTO 330
  49.          D=1
  50.          GOTO 330
  51.          PRINT
  52.          IF C<>N THEN GOTO 1000.2
  53.          D=D+1
  54. 740     N=N+1
  55. 750   A1=INT(25*D*RND+1)
  56.     A2=INT(5*D*RND+1)
  57.     Q=INT(A1/A2)
  58.     R=A1-A2*Q
  59.     IF R/A2<.1 THEN GOTO 750
  60.     PRINT "WHAT IS THE DECIMAL EQUIVALENT OF"
  61.     PRINT Q; " AND " ;R;"/";A2;
  62.      A=INT((A1/A2+.005)*100)/100
  63. RETURN
  64. 840     INPUT X$
  65. RANDOMIZE
  66. IF X$="QUIT" THEN GOTO 1000.2
  67. X=VAL(X$)
  68.          IF ABS(X-A) > .005 THEN 880
  69.          A$="C"
  70.          RETURN
  71. 880     PRINT "NOT CORRECT. ";
  72.          A$="I"
  73. RETURN
  74. %INCLUDE GRADE
  75.  
  76.          END
  77.  
  78.