home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpmug
/
cpmug037.ark
/
FRAC3.BAS
< prev
next >
Wrap
BASIC Source File
|
1984-04-29
|
3KB
|
106 lines
%INCLUDE HEADER
REM ********************FRAC3************************
DRILL.NAME$="MULTIPLICATION OF FRACTIONS"
REM MULTIPLICATION OF FRACTIONS
PRINT
B=10
P=9
D=4
PRINT "OK, ";N$;". Now let's practice multiplying fractions. I will"
PRINT "give you two fractions and you give me their product in"
PRINT "lowest terms. To do this, enter the numerator first, '/',"
PRINT "then the denominator of the answer. "
PRINT
C=0
I=0
N=0
210 GOSUB 700
GOSUB 800
IF A$<>"C" THEN GOTO 270
240 C=C+1
I=I+1
GOTO 430
270 PRINT " TRY AGAIN."
IF A$<>"L" THEN GOTO 360
GOSUB 800
IF A$="C" THEN GOTO 240
IF A$<>"L" THEN GOTO 380
PRINT " ONE MORE TRY."
GOSUB 800
IF A$="C" THEN GOTO 240
GOTO 410
360 GOSUB 800
IF A$="C" THEN GOTO 430
380 PRINT " TRY ONE MORE TIME"
GOSUB 800
IF A$="C" THEN GOTO 430
410 PRINT " THE ANSWER IS ";U;"/";L
I=0
430 IF I>P*C/N THEN GOTO 1000.2
IF N<7 THEN GOTO 210
IF C/N >= .7 THEN GOTO 210
IF D=1 THEN GOTO 210
D=D-1
IF C/N >= .5 THEN GOTO 210
D=1
GOTO 210
IF C<>N THEN GOTO 1000.2
D=D+1
700 N=N+1
U=INT(3*D*RND+1)
L=INT(3*D*RND+1)
Z1=INT(3*D*RND+1)
Z2=INT(3*D*RND+1)
PRINT
PRINT " ","(";U;"/";L;") * (";Z1;"/";Z2;") = ";
U=U*Z1
L=L*Z2
RETURN
800 INPUT LINE Z$
RANDOMIZE
IF Z$="QUIT" THEN GOTO 1000.2
Z1=VAL(LEFT$(Z$,MATCH("/",Z$,1)))
Z2=VAL(MID$(Z$,MATCH("/",Z$,1)+1,LEN(Z$)))
W1=U
W2=L
GOSUB 1060
U=W1
L=W2
IF Z1<>U THEN GOTO 920
IF Z2=0 THEN GOTO 1020
IF Z2<>L THEN GOTO 920
PRINT U;"/";L;" IS CORRECT."
A$="C"
RETURN
920 W1=Z1
W2=Z2
GOSUB 1060
Z1=W1
Z2=W2
IF Z1<>U THEN GOTO 1020
IF Z2<>L THEN GOTO 1020
PRINT "Not in lowest terms. ";
A$="L"
RETURN
1020 PRINT "Not correct. ";
I=0
A$="I"
RETURN
1060 K1=W1
K2=W2
1080 J=INT(W1/W2)
R=W1-J*W2
IF R=0 THEN GOTO 1140
W1=W2
W2=R
GOTO 1080
1140 R=W2
W1=K1/R
W2=K2/R
RETURN
%INCLUDE GRADE
END