mirror of
https://github.com/rfivet/BCG101.git
synced 2024-12-18 16:16:32 -05:00
38 lines
813 B
QBasic
38 lines
813 B
QBasic
|
90 RANDOMIZE
|
||
|
100 PRINT
|
||
|
105 PRINT
|
||
|
106 Q=0
|
||
|
110 V=5+INT(35*RND(0))
|
||
|
111 PRINT "A BALL IS THROWN UPWARDS AT"V"METERS PER SECOND."
|
||
|
112 PRINT
|
||
|
115 A=V^2/19.6
|
||
|
116 PRINT "HOW HIGH WILL IT GO (IN METERS)";
|
||
|
117 GOSUB 500
|
||
|
120 A=V/4.9
|
||
|
122 PRINT "HOW LONG UNTIL IT RETURNS (IN SECONDS)";
|
||
|
124 GOSUB 500
|
||
|
130 T=1+INT(2*V*RND(1))/10
|
||
|
132 A=V-9.8*T
|
||
|
134 PRINT "WHAT WILL ITS VELOCITY BE AFTER"T"SECONDS";
|
||
|
136 GOSUB 500
|
||
|
140 PRINT
|
||
|
150 PRINT Q"RIGHT OUT OF 3.";
|
||
|
160 IF Q<2 THEN 100
|
||
|
170 PRINT " NOT BAD."
|
||
|
180 GOTO 100
|
||
|
500 INPUT G
|
||
|
501 G=100*ABS(G-A)
|
||
|
502 IF G<=ABS(A) THEN 507
|
||
|
503 IF G<=15*ABS(A) THEN 510
|
||
|
504 PRINT "NOT EVEN CLOSE...."
|
||
|
506 GOTO 512
|
||
|
507 Q=Q+1
|
||
|
508 PRINT "CORRECT! VERY GOOD!"
|
||
|
509 GOTO 520
|
||
|
510 PRINT "CLOSE ENOUGH."
|
||
|
511 Q=Q+1
|
||
|
512 PRINT "CORRECT ANSWER IS "A
|
||
|
520 PRINT
|
||
|
530 RETURN
|
||
|
999 END
|