10 REM Program P21 "Travel Costs"
20 BORDER 6: PAPER 7: INK 0: CLS
30 PRINT AT 10,7;"\{vi}TRAVEL\{vn} \{vi}COSTS\{vn}"
40 PAUSE 100: CLS
50 PRINT AT 4,3;"This program can be used to calculate the mileage costs between major towns in the U.K. At the moment only 10 towns are in the program, but the program could be expanded to fit your own needs."
60 PRINT AT 20,3;"\{vi}PRESS\{vn} \{vi}ANY\{vn} \{vi}KEY\{vn} \{vi}TO\{vnvn} \{vi}CONTINUE\{vn}"
70 PAUSE 0: CLS
80 DIM c(10,10): REM array of mileages
90 FOR i=1 TO 10
100 FOR j=1 TO i-1
110 READ c(i,j)
120 LET c(j,i)=c(i,j)
130 NEXT j
140 NEXT i
150 FOR i=1 TO 10: LET c(i,i)=0: NEXT i
160 CLS
170 INPUT"Enter mileage rate in \`";r
180 PRINT "Mileage rate=\`";r
190 INPUT "Enter starting town";t$
200 RESTORE 1000
210 LET i=1
220 READ s$
230 IF s$<>t$ THEN LET i=i+1: GO TO 220
240 INPUT "Enter finish town";u$
250 RESTORE 1000
260 LET j=1
270 READ s$
280 IF s$<>u$ THEN LET j=j+1: GO TO 270
290 PRINT ""
300 PRINT "Starting town is ";t$
310 PRINT "Finishing town is ";u$
320 PRINT ""
330 PRINT "Distance = ";c(i,j);" miles"
340 PRINT "Expenses = \`";c(i,j)*r
350 INPUT "Another go?";a$
360 IF a$(1)="y" THEN GO TO 160
370 STOP
380 DATA 220,135,141,66,278,197,147,170,34,210,131,91,43,196,72,341,150,214,402,221,215,344,109,218,405,225,206,45,54,198,88,117,98,115,289,293,480,236,354,543,362,333,149,127,430
390 DATA "Northampton","Newcastle-on-Tyne","Manchester","London","Liverpool","Leeds","Glasgow","Edinburgh","Birmingham","Aberdeen"