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 >
Wrap
BASIC Source File
|
1984-04-29
|
2KB
|
78 lines
%INCLUDE HEADER
REM ***************DEC2
DRILL.NAME$="Change Mixed Fractions to Decimals"
REM THIS DRILL CHANGES MIXED FRACTIONS TO DECIMALS
PRINT
B=17
P=9
D=4
PRINT
PRINT " ";
GOSUB 740
PRINT "?"
PRINT
PRINT "You must change the fraction to a decimal number and give me"
PRINT "the answer correct at least to the nearest hundredth."
PRINT
PRINT "To solve the sample problem, you should convert the fraction"
PRINT R;"/";A2;" to the decimal fraction ";A
PRINT "BY dividing, round the decimal fraction to"
PRINT "the nearest hundredth, and add it to"
PRINT q; "to get the correct answer of ";a;"."
PRINT
PRINT
C=0
I=0
N=0
330 GOSUB 740
GOSUB 840
IF A$<>"C" THEN GOTO 390
360 C=C+1
C=C+1
I=I+1
GOTO 470
I=0
390 PRINT " TRY AGAIN."
GOSUB 840
IF A$="C" THEN GOTO 470
380 PRINT " TRY ONE MORE TIME"
GOSUB 840
IF A$="C" THEN GOTO 470
410 PRINT " THE ANSWER IS ";A
470 IF I>P*C/N THEN GOTO 1000.2
IF N<7 THEN GOTO 330
IF C/N >= .7 THEN GOTO 330
IF D=1 THEN GOTO 330
D=D-1
IF C/N >= .5 THEN GOTO 330
D=1
GOTO 330
PRINT
IF C<>N THEN GOTO 1000.2
D=D+1
740 N=N+1
750 A1=INT(25*D*RND+1)
A2=INT(5*D*RND+1)
Q=INT(A1/A2)
R=A1-A2*Q
IF R/A2<.1 THEN GOTO 750
PRINT "WHAT IS THE DECIMAL EQUIVALENT OF"
PRINT Q; " AND " ;R;"/";A2;
A=INT((A1/A2+.005)*100)/100
RETURN
840 INPUT X$
RANDOMIZE
IF X$="QUIT" THEN GOTO 1000.2
X=VAL(X$)
IF ABS(X-A) > .005 THEN 880
A$="C"
RETURN
880 PRINT "NOT CORRECT. ";
A$="I"
RETURN
%INCLUDE GRADE
END