Sha256: 3725954be7d83aca9daec3e59118768ac7f4c0fa7610b2f163e183786cdd8a9a

Contents?: true

Size: 737 Bytes

Versions: 6

Compression:

Stored size: 737 Bytes

Contents

1 PRINT TAB(33);"TRAIN"
2 PRINT TAB(15);"CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
3 PRINT: PRINT: PRINT
4 PRINT "TIME - SPEED DISTANCE EXERCISE": PRINT
10 C=INT(25*RND(1))+40
15 D=INT(15*RND(1))+5
20 T=INT(19*RND(1))+20
25 PRINT " A CAR TRAVELING";C;"MPH CAN MAKE A CERTAIN TRIP IN"
30 PRINT D;"HOURS LESS THAN A TRAIN TRAVELING AT";T;"MPH."
35 PRINT "HOW LONG DOES THE TRIP TAKE BY CAR";
40 INPUT A
45 V=D*T/(C-T)
50 E=INT(ABS((V-A)*100/A)+.5)
55 IF E>5 THEN 70
60 PRINT "GOOD! ANSWER WITHIN";E;"PERCENT."
65 GOTO 80
70 PRINT "SORRY.  YOU WERE OFF BY";E;"PERCENT."
80 PRINT "CORRECT ANSWER IS";V;"HOURS."
90 PRINT
95 PRINT "ANOTHER PROBLEM (YES OR NO)";
100 INPUT A$
105 PRINT
110 IF A$="YES" THEN 10
999 END

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
basic101-1.0.2 test/integration/tests/basic_computer_games/train.bas
basic101-1.0.1 test/integration/tests/basic_computer_games/train.bas
basic101-1.0.0 test/integration/tests/basic_computer_games/train.bas
basic101-0.4.0 test/integration/tests/basic_computer_games/train.bas
basic101-0.2.0 test/integration/tests/basic_computer_games/train.bas
basic101-0.1.0 test/integration/tests/basic_computer_games/train.bas