File TRAIN.BA (BASIC source file)

Directory of image this file is from
This file as a plain text file

4 PRINT "TIME - SPEED - DISTANCE EXERCISE"\PRINT
5 RANDOMIZE
10 C=INT(RND(0)*25)+40
15 D=INT(RND(0)*15)+5
20 T=INT(RND(0)*19)+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$\PRINT
105 IF A$="YES" THEN 10
999 END



Feel free to contact me, David Gesswein djg@pdp8online.com with any questions, comments on the web site, or if you have related equipment, documentation, software etc. you are willing to part with.  I am interested in anything PDP-8 related, computers, peripherals used with them, DEC or third party, or documentation. 

PDP-8 Home Page   PDP-8 Site Map   PDP-8 Site Search