Mileage Converter

—————————————————————————————-

UPDATE: December 01, 2024

I have posted here the AppleSoft code listing for Mileage Converter, removing the old listing from the basic app I had on my iPad, as that app doesn’t seem to work any longer, so I converted that code AppleSoft, and it appears to run properly.

—————————————————————————————-

Howdy folks! Recently I started to re-dable (now that’s a funny word, if in fact it is a real word) with BASIC programming. Programming in BASIC, for me, goes all the way back to being twelve to fourteen years old, somewhere in the early 80’s. That’s when the Apple ][+ ruled the personal computer world!

I am including the code to what I’ve written so far if you’d like to try it out. Be aware that not all versions of BASIC use exactly the same syntax or commands but if your willing to give this a go, you probably already know that.

10 REM Convert l/100 to us & i
mp and back
12 REM by Wayne Goldsmith
13 HOME
15 GOSUB 500
35 PRINT
40 PRINT “1) L/100 TO IMPERIAL
MPG”
45 PRINT “2) IMPERIAL MPG TO L/
100”
50 PRINT “3) L/100 TO US MPG”
55 PRINT “4) US MPG TO L/100”
57 PRINT “5) QUIT”
60 PRINT
65 INPUT “PLEASE ENTER YOUR CHO
ICE “;C
70 IF C = 1 THEN GOSUB 135
80 IF C = 2 THEN GOSUB 180
90 IF C = 3 THEN GOSUB 250
100 IF C = 4 THEN GOSUB 320
110 IF C = 5 THEN HOME : GOSUB
400
120 GOTO 13
135 REM l/100 to imp mpg
136 PRINT
140 INPUT “PLEASE ENTER YOUR L/
100 TO CONVERT “;L
150 MPG = 282.48 / L
155 PRINT
157 PRINT
160 PRINT “YOUR L/100 EQUALS “M
PG” IMPERIAL MPG”
165 PRINT
166 PRINT
168 GOSUB 450
170 RETURN
180 REM imp mpg to l/100
181 PRINT
190 INPUT “PLEASE ENTER YOUR IM
PERIAL MPG. “;MPG
200 L = 282.48 / MPG
210 PRINT
220 PRINT
230 PRINT “YOUR IMPERIAL MPG EQ
UALS “L” L/100″
235 PRINT
236 PRINT
238 GOSUB 450
240 RETURN
250 REM l/100 to us mpg
251 PRINT
260 INPUT “PLEASE ENTER YOUR L/
100 “;L
270 MPG = 235.2 / L
280 PRINT
290 PRINT
300 PRINT “YOUR “L” L/100 EQUAL
S “MPG” US MPG”
305 PRINT
306 PRINT
308 GOSUB 450
310 RETURN
320 REM US MPG to L/100
321 PRINT
330 INPUT “PLEASE ENTER YOUR US
MPG “;MPG
340 L = 235.2 / MPG
350 PRINT
360 PRINT
370 PRINT “YOUR “MPG” US MPG EQ
UALS “L” L/100″
375 PRINT
376 PRINT
378 GOSUB 450
380 RETURN
390 GOTO 20
400 PRINT
415 GOSUB 500
420 HTAB 15: PRINT “THANK YOU”
423 HTAB 13: PRINT “FOR USING T
HE”
425 HTAB 8: PRINT “MULTI-MILEAG
E CONVERTER”
430 END
450 INPUT “PRESS C TO CONTINUE,
OR Q TO QUIT. “;D$
460 IF D$ = “C” THEN RETURN
470 IF D$ = “Q” THEN HOME : GOTO
400
480 GOTO 450
500 PRINT “********************
********************”
510 PRINT : HTAB 6: PRINT “THE
MULTI-MILEAGE CONVERTER”
515 PRINT : PRINT : HTAB 10: PRINT
“WAYNE GOLDSMITH 2023”
520 PRINT : PRINT “************
****************************

530 RETURN

 

Leave a Reply