home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpmug
/
cpmug037.ark
/
DEC1.BAS
< prev
next >
Wrap
BASIC Source File
|
1984-04-29
|
2KB
|
96 lines
%INCLUDE HEADER
REM ****************DEC1
REM THIS DRILL IS FORM ROUNDING DECIMALS
DRILL.NAME$="Rounding of Decimals"
PRINT
B=16
P=9
D=4
PRINT
PRINT "OK ";N$;". Now let's practice rounding decimal numbers. I'll"
PRINT "give you a number which must be rounded using the 'round-up'"
PRINT "method. Please read each question carefully, and then give me"
PRINT "the correct answer."
PRINT
C=0
I=0
N=0
220 GOSUB 640
GOSUB 940
IF A$<>"C" THEN GOTO 280
250 C=C+1
I=I+1
GOTO 360
I=0
280 PRINT " TRY AGAIN."
GOSUB 940
IF A$="C" THEN GOTO 360
380 PRINT " TRY ONE MORE TIME"
GOSUB 940
IF A$="C" THEN GOTO 360
410 PRINT " THE ANSWER IS "; A
360 IF I>P*C/N THEN GOTO 1000.2
IF N<7 THEN GOTO 220
IF C/N >= .7 THEN GOTO 220
IF D=1 THEN GOTO 220
D=D-1
IF C/N >= .5 THEN GOTO 220
D=1
GOTO 220
PRINT
IF C<>N THEN GOTO 1000.2
D=D+1
640 N=N+1
A=INT(RND*10^(D+2))/10^(D+2)
IF A < .1 THEN 640
R = INT(RND * (D+2))
A=A*10^R
IF A < .1 THEN 640
IF D < 5 THEN 720
X=4
GOTO 940
720 X=D
730 Z=INT((RND-.4)*10)
IF Z>4 THEN 730
IF Z<0 THEN 730
IF Z >= R THEN 730
IF Z <= R - D - 2 THEN 730
PRINT
PRINT "WHAT IS ";A;"ROUNDED TO THE NEAREST ";
IF Z <> 0 THEN 810
PRINT "WHOLE NUMBER";
LET A=INT(A+.5)
RETURN
810 IF ABS(Z)<>1 THEN 840
PRINT "TEN";
GOTO 900
840 IF ABS(Z) <> 2 THEN 870
PRINT "HUNDRED";
GOTO 900
870 IF ABS(Z) <> 2 THEN 890
PRINT "TEN ";
890 PRINT "THOUSAND";
PRINT "TH";
900 IF Z > 0 THEN 920
920 A=INT((A*10^Z)+.5)/(10^Z)
RETURN
940 INPUT X$
RANDOMIZE
IF X$="QUIT" THEN GOTO 1000.2
X=VAL(X$)
IF X <> A THEN 980
A$ = "C"
RETURN
980 PRINT "NOT CORRECT. ";
A$="I"
RETURN
%INCLUDE GRADE
END