00001 PRINT TAB(33);"TRAIN"
00002 PRINT TAB(15);"CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
00003 print
00004 print
00005 print
00008 print "TIME - SPEED DISTANCE EXERCISE"
00009 print
00010 C=INT(25*RND)+40
00015 D=INT(15*RND)+5
00020 T=INT(19*RND)+20
00025 PRINT " A CAR TRAVELING";C;"MPH CAN MAKE A CERTAIN TRIP IN"
00030 PRINT D;"HOURS LESS THAN A TRAIN TRAVELING AT";T;"MPH."
00035 PRINT "HOW LONG DOES THE TRIP TAKE BY CAR";
00040 INPUT A
00045 V=D*T/(C-T)
00050 E=INT(ABS((V-A)*100/A)+.5)
00055 IF E>5 THEN 70
00060 PRINT "GOOD! ANSWER WITHIN";E;"PERCENT."
00065 GOTO 80
00070 PRINT "SORRY.  YOU WERE OFF BY";E;"PERCENT."
00080 PRINT "CORRECT ANSWER IS";V;"HOURS."
00090 PRINT
00095 PRINT "ANOTHER PROBLEM (YES OR NO)";
00100 INPUT A$
00105 PRINT
00110 IF A$="YES" THEN 10
00999 END