home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpmug
/
cpmug037.ark
/
DEC4.BAS
< prev
next >
Wrap
BASIC Source File
|
1984-04-29
|
3KB
|
107 lines
%INCLUDE HEADER
REM **********************DEC 4
DRILL.NAME$="Addition of Decimal Numbers"
DIM A(8)
DEF FNT(X)=X-INT(X/100)*100+INT(X/100)*60
P=9
D=4
PRINT "OK, ";N$;", LET'S PRACTICE ADDING DECIMAL NUMBERS. IF YOU HAVE"
PRINT "DIFFICULTY WITH A PROBLEM, ENTER -1 INSTEAD OF AN"
PRINT "ANSWER, AND I'LL TRY TO GIVE YOU SOME ASSISTANCE."
PRINT
PRINT
C=0
I=0
N=0
230 GOSUB 640
GOSUB 890
IF A$<>"C" THEN GOTO 290
360 C=C+1
C=C+1
I=I+1
GOTO 370
I=0
290 PRINT " TRY AGAIN."
GOSUB 890
IF A$="C" THEN GOTO 370
380 PRINT " TRY ONE MORE TIME"
GOSUB 890
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
640 N=N+1
FOR J=1 TO 6
A(J)=0
NEXT J
680 X=D+1
GOSUB 1180
A=X
IF A < .1 THEN GOTO 680
A(1)=A
PRINT
Q=FNR(D) + 1
FOR J=2 TO Q
X=D+1
GOSUB 1180
A1=X
IF A1 < .1 THEN GOTO 680
A(J)=A1
A=A+A1
NEXT J
830 PRINT " ";A(1);
FOR J=2 TO Q
PRINT "+";A(J);
NEXT J
PRINT "= ";
RETURN
890 INPUT X$
RANDOMIZE
IF X$="QUIT" THEN GOTO 1000.2
X=VAL(X$)
IF A <> X THEN 930
A$="C"
RETURN
930 IF X = -1 THEN 980
PRINT "NOT CORRECT. ";
I=0
A$="I"
RETURN
980 PRINT
PRINT "CHECK TO MAKE SURE THAT ALL THE DECIMAL POINTS ARE IN LINE."
PRINT "FOR INSTANCE, IF YOUR PROBLEM WAS TO ADD"
PRINT "4.56 + 165.8 + 7 + 14.001, YOU SHOULD WRITE"
PRINT "LIKE THIS:"
PRINT
PRINT " 4.560"
PRINT " 165.800"
PRINT " 7.000"
PRINT " 14.001"
PRINT " --------"
PRINT " 191.361"
PRINT
PRINT "IF YOUR PROBLEM LOOKS LIKE THIS, YOU PROBABLY HAVE BEEN MAKING"
PRINT "MISTAKES IN ADDITION. WORK YOUR PROBLEM CAREFULLY NOW, AND"
PRINT "I'LL CHECK YOUR ANSWERS."
X=0
PRINT "HERE IT IS AGAIN:"
GOSUB 830
GOTO 890
1180 X=FNR(X)
X=INT(RND*10^X)/10^INT(FNR(X))
RETURN
%INCLUDE GRADE
END