8-Bit Software Online Conversion
Units Conversion - Listing
10 REM" (C)John Ilsley. 1992.
20 ON ERROR REPORT:PRINT;" AT LINE ";
ERL:END
30 *TV255,1
40 MODE 0
50 DEFPROCMENU
60 CLS
70 CLEAR
80 PRINTTAB(40-4,0)"Menu"
90 GOSUB 590
100 INPUT TAB(5,27)"Please Enter A Let
ter(S). "Z$
110 IF Z$="AN" THEN PROCTEMP2
120 IF Z$="AM" THEN PROCTEMP1
130 IF Z$="AO" THEN GOTO 1130
140 IF Z$="AP" THEN GOTO 1130
150 IF Z$="ZZ" THEN CALL!-4
160 IF Z$="1" THEN RUN
170 IF Z$="2" THEN RUN
180 IF Z$="3" THEN RUN
190 IF Z$="4" THEN RUN
200 IF Z$="5" THEN RUN
210 IF Z$="6" THEN RUN
220 IF Z$="7" THEN RUN
230 IF Z$="8" THEN RUN
240 IF Z$="9" THEN RUN
250 IF Z$="0" THEN RUN
260 IF Z$ ="" THEN GOTO 100
270 RESTORE490
280 READ Q$,F$,S$,S
290 IF F$="ZZZZ" THEN PROCMENU : ENDPR
OC
300 IF Z$=Q$ THEN PROCQUESTION : ENDPR
OC
310 GOTO 280
320 DEFPROCQUESTION
330 CLS
340 L=LEN(F$+" "+S$)
350 T=40-4-(L/2)
360 PRINTTAB(T,0)"Convert ";F$;" To ";
S$;"."
370 PRINT'''"How Many ";F$; : INPUT;A$
380 E=EVAL(A$)
390 A=E
400 PRINT'''"In ";A;" ";F$;" There Are
:"
410 PRINT
420 PRINT'" : ";A*S;" : ";S$
430 PRINTTAB(40-5,25)"Again? Y/N."
440 A$=GET$
450 IF A$="Y" THEN CLS : GOTO 360
460 IF A$="N" THEN PROCMENU : ENDPROC
470 IF A$<>"" THEN VDU 7 : GOTO 440
480 ENDPROC
490 DATA A,Inches,C/Mtrs,2.540,B,C/Mtr
s,Inches,0.3937,C,Ft,Mtrs,0.3048,D,Mtrs,
Ft,3.281,E,Yrds,Mtrs,0.9144,F,Mtrs,Yrds,
1.094,G,Miles,K/Mtrs,1.609,H,K/Mtrs,Mile
s,0.6214,I,Sq Inches,Sq C/Mtrs,6.452
500 DATA J,Sq C/Mtrs,Sq Inches,0.1550,
K,Sq Mtrs,Sq Ft,10.76,L,Sq Ft,Sq Mtrs,0.
0929,M,Sq Yrds,Sq Mtrs,0.8361,N,Sq Mtrs,
Sq Yrds,1.196,O,Sq Miles,Sq K/Mtrs,2.590
,P,Sq K/Mtrs,Sq Miles,0.3861,Q,Acres,Hec
tares,0.4047
510 DATA R,Hectares,Acres,2.471,S,Cb I
nches,Cb C/Mtrs,16.39,T,Cb C/Mtrs,Cb Inc
hes,0.06102,U,Cb Ft,Cb Mtrs,0.02832,V,Cb
Mtrs,Cb Ft,35.31,W,Cb Yrds,Cb Mtrs,0.76
46,X,Cb Mtrs,Cb Yrds,1.308,Y,Cb Inches,L
trs,0.01639
520 DATA Z,Ltrs,Cb Inches,61.024,AA,Ga
llons,Ltrs,4.546,AB,Ltrs,Gallons,0.22,AC
,Grains,Grams,0.648,AD,Grams,Grains,15.4
3,AE,Ounces,Grams,28.35,AF,Grams,Ounces,
0.03527,AG,Pounds,Grams,453.6,AH,Grams,P
ounds,0.002205
530 DATA AI,Pounds,K/Grams,0.4536,AJ,K
/Grams,Pounds,2.205,AK,Tons,K/Grams,1016
.00,AL,K/Grams,Tons,0.0009842
540 DATA AO,Inches,Milli/Mtrs,25.400,A
P,Milli/Mtrs,Inches,0.039,AQ,Ltrs,Pints,
1.760,AR,Pints,Ltrs,0.568
550 DATA AM,Deg F,Deg C,0,AN,Deg C,Deg
F,1
560 DATA AO,Distance,Fuel Cost,0,AP,Sp
eed,Time,0
570 DATA ZZ,QUIT,,100
580 DATA ZZZZ,ZZZZ,ZZZZ,0
590 RESTORE 490
600 L=2
610 READ A$,B$,C$,D
620 IF B$ = "ZZZZ" THEN RETURN
630 PRINTTAB(0,L);A$;" = ";B$;TAB(13);
" : ";TAB(18);C$;
640 READ A$,B$,C$,D
650 IF B$="ZZZZ" THEN RETURN
660 PRINTTAB(40,L)A$" = "B$
670 PRINTTAB(52,L)" : ";C$
680 L=L+1
690 GOTO 610
700 RETURN
710 DEFPROCTEMP2
720 CLS
730 RESTORE490
740 READ Q$,F$,S$,S
750 IF F$="ZZZZ" THEN PROCMENU : ENDPR
OC
760 IF Z$=Q$ THEN GOTO 780
770 GOTO 740
780 L=LEN(F$+" "+S$)
790 T=40-4-(L/2)
800 PRINTTAB(T,0)"Convert ";F$;" To ";
S$;"."
810 PRINT'''"How Many ";F$; : INPUT" "
A
820 LET B=(9/5)*A+32
830 PRINT'''"At ";A;" ";F$;" The Temp
Is :"
840 PRINT
850 PRINT'" : ";B;" : ";S$;"."
860 PRINTTAB(40-5,25)"Again? Y/N."
870 A$=GET$
880 IF A$ = "Y" THEN CLS : GOTO 780
890 IF A$="N" THEN GOTO 910
900 GOTO 870
910 PROCMENU : ENDPROC
920 DEFPROCTEMP1
930 CLS
940 RESTORE 490
950 READ Q$,F$,S$,S
960 IF F$="ZZZZ" THEN PROCMENU : ENDPR
OC
970 IF Z$=Q$ THEN GOTO 990
980 GOTO 950
990 L=LEN(F$+" "+S$)
1000 T=40-4-(L/2)
1010 PRINTTAB(T,0)"Convert ";F$;" To ";
S$;"."
1020 PRINT'''"How Many ";F$; : INPUT" "
A
1030 LET B=(A-32)*5/9
1040 PRINT'''"At ";A;" ";F$;" The Temp
Is :"
1050 PRINT
1060 PRINT'" : ";B;" : ";S$;"."
1070 PRINTTAB(40-5,25)"Again? Y/N."
1080 A$=GET$
1090 IF A$ = "Y" THEN CLS : GOTO 1010
1100 IF A$="N" THEN GOTO 1120
1110 GOTO 1080
1120 PROCMENU : ENDPROC
1130 IF Z$="AO" THEN GOTO 1140 ELSE GOT
O 1250
1140 CLEAR:*TV255,1
1150 MODE7:PRINTTAB(20-(15/2),0)"FUEL C
ONVERSTION":PRINTTAB(20-(19/2),1)" ====
===============":PRINT:PRINT"GENERAL INF
ORMATION":PRINT"===================":PRI
NT:PRINT"AVERAGE MPG = 69.99 MLS : MPL =
15.32":PRINT"RESERVE GAL = 30.79 MLS :
LTR = 30.64"
1160 PRINT:PRINT"OVERALL TANK MILEAGE =
168.52 MLS":PRINT'':INPUT"ENTER TOTAL D
ISTANCE = ";D
1170 IF D=0 THEN END
1180 INPUT"ENTER COST PER LTR £ = ";C:
PRINT:PRINT:Q=D/15.32:W$=STR$(Q):E$=".":
A=INSTR(W$,E$):PRINT"COST OF FUEL NEEDED
= ";LEFT$(W$,A+2);" LTRS.":O=A:O$=W$:E=
Q*C:W$=STR$(E):E$=".":A=INSTR(W$,E$):PRI
NT:PRINT"COST OF FUEL NEEDED = £ ";LEFT$
(W$,A+2):P=A
1190 P$=W$
1200PRINT'"RUN AGAIN Y/n":B$=GET$
1210IF B$="N" THEN RUN ELSE 1140
1220 GOTO 1200
1230:
1240:
1250 MODE7:REM
1260PRINTTAB(20-(9/2),0)"MILEAGE &":PRI
NTTAB(20-(13/2),1)"TIME PROGRAM":PRINTTA
B(20-(15/2),2)"==============":PRINT'':I
NPUT"ENTER TOTAL DISTANCE........: "M:IF
M=0 THEN END
1270 PRINT:INPUT"ENTER APPROXIMATER SPE
ED....: "S
1280 CLS
1290 PRINT:PRINT:PRINT"THE APPROXIMATE
TRAVEL TIME FOLLOWS":PRINT:PRINT":AVERAG
E : TOTAL : APPROXIMATE :":PRINT": SP
EED : DISTANCE : HR . MINS :":PRINT"-
----------------------------------"
1300 E=8:FOR D=S-5 TO S+5:PRINTTAB(0,E)
;": ";D:PRINTTAB(9,E);": ";M:PRINTTA
B(34,E);":":Q=(M/D):W$=STR$(Q):E$=".":A=
INSTR(W$,E$):PRINTTAB(20,E);": ";LEFT
$(W$,A+2):E=E+1:NEXT
1310 PRINT'"RUN AGAIN Y/n":B$=GET$
1320 IF B$="N" THEN RUN ELSE 1250
1330 *TDUMP
1340 GOTO 1310