home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpmug
/
cpmug037.ark
/
PERCENT.BAS
< prev
next >
Wrap
BASIC Source File
|
1984-04-29
|
2KB
|
93 lines
%INCLUDE HEADER
REM **********************PERCENT************************
REM WORKING WITH PERCENTS
DRILL.NAME$="Working with Percents"
PRINT
B=14
10 DEF FND(X) = INT(RND * 10 ^ X)/10 ^ FNR(X - 1)
IF FND(X)=0 THEN GOTO 10
P=9
D=4
PRINT
PRINT "OK, ";N$;". Let's practice solving some problems which"
PRINT "deal with percents. I will give you a problem, and I want you"
PRINT "to give me your answer, which I will check."
PRINT
PRINT "your answer should be correct to the nearest humndredth."
PRINT
C=0
N=0
I=0
260 GOSUB 670
GOSUB 1000
IF A$ <> "C" THEN 320
C=C + 1
I = I + 1
GOTO 400
320 I = 0
PRINT " TRY AGAIN."
GOSUB 1000
IF A$ = "C" THEN 400
PRINT " TRY ONE MORE TIME."
GOSUB 1000
IF A$="C" THEN 400
PRINT " THE ANSWER IS ";A;P$
400 IF I > P * C/N THEN 1000.2
IF N < 7 THEN 260
IF C/N >= .7 THEN 260
IF D = 1 THEN 260
D = D - 1
IF C/N >= .5 THEN 260
D = 1
GOTO 260
IF C <> N THEN 1000.2
D = D + 1
670 PRINT
N = N + 1
A = FND(FNR(D))
X = FNR(5)
IF X = 2 THEN 780
IF X = 3 THEN 820
IF X = 4 THEN 880
IF X = 5 THEN 940
PRINT " ","WHAT IS";A*100;"% EXPRESSED AS A DECIMAL";
P$ = " "
GOTO 990
780 PRINT " ",A;"IS WHAT PERCENT";
A = A * 100
P$ = "%"
GOTO 990
820 A1 = FNR(5 * D)
A2 = FNR(5 * D)
PRINT " ",A1;"IS WHAT PERCENT OF";A2;
A = INT(A1/A2 * 10^4)/100
P$ = "%"
GOTO 990
880 A1 = FND(FNR(D))
A2 = FNR(10 * D)
PRINT " ","WHAT IS";A1 * 100;"% OF";A2;
A = INT(A1 * A2 * 100)/100
P$=" "
GOTO 990
940 A = FNR(D)
A1 = FND(FNR(D))
PRINT " ",A * A1;"IS";A1 * 100;"% OF SOME NUMBER."
PRINT " "," WHAT IS THAT NUMBER?";
P$=" "
990 RETURN
1000 INPUT LINE X$
RANDOMIZE
IF X$="QUIT" THEN GOTO 1000.2
X=VAL(X$)
IF ABS(X-A) > .5 THEN 1040
A$ = "C"
RETURN
1040 PRINT "NOT CORRECT. ";
I = 0
A$="I"
RETURN
%INCLUDE GRADE
END