home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpmug
/
cpmug037.ark
/
DEC3.BAS
< prev
next >
Wrap
BASIC Source File
|
1983-08-29
|
2KB
|
89 lines
%INCLUDE HEADER
REM ***************DEC3
DRILL.NAME$="Subtraction of Decimal Numbers"
B=19
P=9
D=4
PRINT "OK, ";N$;", Let's practice subtracting decimal numbers. If"
PRINT "you have difficulty with a problem, enter"
PRINT "-1 instead of an answer, and I'll try to give you"
PRINT "some assistance."
PRINT
C=0
I=0
N=0
230 GOSUB 640
GOSUB 740
IF A$<>"C" THEN GOTO 290
360 C=C+1
I=I+1
GOTO 370
I=0
290 PRINT " TRY AGAIN."
GOSUB 740
IF A$="C" THEN GOTO 370
380 PRINT " TRY ONE MORE TIME"
GOSUB 740
IF A$="C" THEN GOTO 370
410 PRINT " THE ANSWER IS ";A
370 IF I>P*C/N THEN GOTO 1000.2
IF N<7 THEN GOTO 230
IF C/N >= .7 THEN GOTO 230
IF D=1 THEN GOTO 230
D=D-1
IF C/N >= .5 THEN GOTO 230
D=1
GOTO 230
IF C<>N THEN GOTO 1000.2
D=D+1
REM THIS DRILL IS FOR THE SUBTRACTION OF DECIMALS
640 N=N+1
PRINT
X=2*D
GOSUB 1010
A1=X
X=D*2
GOSUB 1010
A=X
720 PRINT " ",A1+A;"-";A1;"= ";
RETURN
740 INPUT X$
RANDOMIZE
IF X$="QUIT" THEN GOTO 1000.2
X=VAL(X$)
IF A <> X THEN GOTO 780
A$="C"
RETURN
780 IF X = -1 THEN GOTO 830
PRINT "NOT CORRECT. ";
I=0
A$="I"
RETURN
830 PRINT
PRINT "CHECK TO MAKE SURE THAT ALL THE DECIMAL POINTS ARE IN LINE."
PRINT "FOR EXAMPLE, THE PROBLEM"
PRINT " 2.56 - 1.043"
PRINT "WOULD LOOK LIKE THIS:"
PRINT
PRINT " 2.560"
PRINT " - 1.043"
PRINT" -------- "
PRINT " 1.517"
PRINT
PRINT
PRINT "IF YOUR PROBLEM LOOKS LIKE THIS, YOU PROBABLY HAVE BEEN MAKING"
PRINT "MISTAKES IN SUBTRACTION. WORK THIS PROBLEM CAREFULL NOW, AND"
PRINT "I'LL CHECK YOUR ANSWER."
X=0
GOSUB 720
GOTO 740
1010 X=FNR(X)
X=INT(RND*10^X)/10^INT(FNR(X))
RETURN
%INCLUDE GRADE
END