The following programs are for the Sinclair QL computer and should be run in Mode 4 (F1). These programs are debugged and operate as they were intended to run. I am sure that the Unit_pricer and Metric_con programs can be streamlined if desired. These and many other programs I have either written or have copied from assorted publications have been compiled using QLiberator so that they load (using EXEC or EXEC)W)[illegible]operate much faster and can be multitasked using CTRL/C. Shortly several disks containing many programs will be available to LIST members. A notice will appear in LISTING when they are available.
Colorbar
98 REMark Program name: Colorbar
99 REMark Bob Gilder January 1990
1000 REMark Colorbar is initiated by typing 'cb'.
1010 REMark The purpose of the colorbaris to verify that the G2 controls within your color monitor are adjusted properly.
1020 REMark There is an exception to this if your monitor is an RGB CGA monitor - where yellow is expected, brown is the result and the white will appear dark.
1030 REMark The circle should appear round; if not; adjust the Horizontal and/or vertical size controls on your monitor until the circle is perfect.
1040 REMark The small inner circle should be dead center on your monitor screen - if not; adjust the horizontal and/or vertical position controls.
1050 REMark One final note: the border is a necessary for proper positioning of the eight colorbars due to the QL's 86 column screen. Remove the borderand observe what happens.
1100 DEFine PROCedure cb
1104 WINDOW #1,448,200,32,16
1108 WINDOW #2,448,200,32,16
1112 WINDOW #0,448,40,32,216
1116 PAPER #1,0: INK #1,5: CLS#1
1120 PAPER #2,0: INK #2,5: CLS#1
1124 PAPER 0: INK 7: CLS
1128 CSIZE #1,1,0
1132 CSIZE #2,1,0
1136 CSIZE #0,1,0
1140 MODE 8:BORDER 15,250:CLS
1144 PAPER 7: CLS
1148 FOR n=1 TO 17
1152 FOR p=0 TO 7
1156 PAPER p: PRINT " ";
1160 NEXT p
1164 NEXT n
1168 INK 0:CIRCLE 71,50,50
1172 INK 0:CIRCLE 71.5,50,.2
1176 END DEFine cb
Unit_Pricer
1 REMark Program name: Unit_Pricer
2 REMark Have you ever wondered which is the better buy
2 for 59 cents or 3 for 80 cents? Here is the answer.
3 DIM u$(1,23)
4 u$(1)="(ounces, liters, etc)"
5 CLS: PRINT" UNIT PRICER"
10 PRINT\"This program compares two grocery","products for the BEST BUY. This is"
20 PRINT"based on their UNIT price. Units","must be consistant for both items,"
30 PRINT"for BEST evaluation. (Ounces, Liters,","etc)."\"@ R. Gilder 01/30/90"
35 PRINT\\" Press <ENTER> to continue!":PAUSE
40 CLS
50 INPUT"What is the brand name of product 1? ";a$
60 PRINT"How much does ";a$;" cost? ":INPUT a
70 PRINT"How many units in the package? ":PRINT u$;" ":INPUT b
80 INPUT"What is the brand name of product 2? ";b$
90 PRINT"How much does ";b$;" cost? ":INPUT c
100 PRINT"How many units in the package? ":PRINT u$;" ":INPUT d
110 e=a/b:f=c/d:e=e*100:f=f*100
115 CLS
120 PRINT a$;"-";e;" cents per unit."
130 PRINT b$;"-";f;" cents per unit."
140 IF e<f THEN GO TO 150
142 IF e=f THEN GO TO 200
145 PRINT b$;" is the better buy."
147 GO TO 250
150 PRINT a$;" is the better buy."
155 GO TO 250
200 PRINT"Both ";a$;" and ";b$;"are equally priced."
250 PRINT"Do require another evaluation? (Y/N)"
260 INPUT;R$
270 IF R$="Y" OR R$="y" THEN GO TO 1
999 STOP
Metric_con
1 REMark Program name: Metric_con
3 REMark Bob Gilder January 1990
5 GO TO 2000
10 CLS: PRINT" METRIC TO U.S. CONVERTER"
20 PRINT\"1] Centimeters to inches"
30 PRINT"2] Meters to yards"
40 PRINT"3] Cubic centimeters to cubic inches"
50 PRINT"4] Kilometers to miles"
60 PRINT"5] Liters to gallons"
70 PRINT"6] Grams to ounces"
80 PRINT"7] Kilograms to pounds"
90 PRINT"8] Inches to centimeters"
100 PRINT"9] Yards to centimeters"
110 PRINT"10] Cubic inches to cubic centimeters"
120 PRINT"11] Miles to kilometers"
130 PRINT"12] Gallons to liters"
140 PRINT"13] Ounces to grams"
150 PRINT"14] Pounds to kilograms"
160 PRINT"15] Degrees F to degrees C"
170 PRINT"16] Degrees C to degrees F"
190 CLS #0
500 INPUT" Enter for your choice: ";ch$
510 :
520 IF ch$=1 THEN PRINT" HOW many ";a$(1); " to ";a$(8);"? ":INPUT b:GO TO 900
530 IF ch$=2 THEN PRINT" HOW many ";a$(2); " to ";a$(9);"? ":INPUT b:GO TO 910
540 IF ch$=3 THEN PRINT" HOW many ";a$(3); " to ";a$(10);"? ":INPUT b:GO TO 920
550 IF ch$=4 THEN PRINT" HOW many ";a$(4); " to ";a$(11);"? ":INPUT b:GO TO 930
560 IF ch$=5 THEN PRINT" HOW many ";a$(5); " to ";a$(12);"? ":INPUT b:GO TO 940
570 IF ch$=6 THEN PRINT" HOW many ";a$(6); " to ";a$(13);"? ":INPUT b:GO TO 950
580 IF ch$=7 THEN PRINT" HOW many ";a$(7); " to ";a$(14);"? ":INPUT b:GO TO 960
590 IF ch$=8 THEN PRINT" HOW many ";a$(8); " to ";a$(1);"? ":INPUT b:GO TO 970
600 IF ch$=9 THEN PRINT" HOW many ";a$(9); " to ";a$(2);"? ":INPUT b:GO TO 980
610 IF ch$=10 THEN PRINT" HOW many ";a$(10); " to ";a$(3);"? ":INPUT b:GO TO 990
620 IF ch$=11 THEN PRINT" HOW many ";a$(11); " to ";a$(4);"? ":INPUT b:GO TO 1000
630 IF ch$=12 THEN PRINT" HOW many ";a$(12); " to ";a$(5);"? ":INPUT b:GO TO 1010
640 IF ch$=13 THEN PRINT" HOW many ";a$(13); " to ";a$(6);"? ":INPUT b:GO TO 1020
650 IF ch$=14 THEN PRINT" HOW many ";a$(14); " to ";a$(7);"? ":INPUT b:GO TO 1030
660 IF ch$=15 THEN PRINT" HOW many ";a$(15); " to ";a$(16);"? ":INPUT b:GO TO 1040
670 IF ch$=16 THEN PRINT" HOW many ";a$(16); " to ";a$(15);"? ":INPUT b:GO TO 1050
900 CLS:c=b:c=c*.3937: PRINT b;" "; a$(1);" = ";c;" ";a$(8):PAUSE:GO TO 2190
910 CLS:c=b:c=c*1.093611: PRINT b;" "; a$(2);" = ";c;" ";a$(9):PAUSE:GO TO 2190
920 CLS:c=b:c=c*6.102338: PRINT b;" "; a$(3);" = ";c;" ";a$(10):PAUSE:GO TO 2190
930 CLS:c=b:c=c*.6213699: PRINT b;" "; a$(4);" = ";c;" ";a$(11):PAUSE:GO TO 2190
940 CLS:c=b:c=c*.264178: PRINT b;" "; a$(5);" = ";c;" ";a$(12):PAUSE:GO TO 2190
950 CLS:c=b:c=c*3.527396E-2: PRINT b;" "; a$(6);" = ";c;" ";a$(13):PAUSE:GO TO 2190
960 CLS:c=b:c=c*2.204622: PRINT b;" "; a$(7);" = ";c;" ";a$(14):PAUSE:GO TO 2190
970 CLS:c=b:c=c*2.540005: PRINT b;" "; a$(8);" = ";c;" ";a$(1):PAUSE:GO TO 2190
980 CLS:c=b:c=c*.9144018: PRINT b;" "; a$(9);" = ";c;" ";a$(2):PAUSE:GO TO 2190
990 CLS:c=b:c=c*1.638716: PRINT b;" "; a$(10);" = ";c;" ";a$(3):PAUSE:GO TO 2190
1000 CLS:c=b:c=c*1.609347: PRINT b;" "; a$(11);" = ";c;" ";a$(4):PAUSE:GO TO 2190
1010 CLS:c=b:c=c*3.785332: PRINT b;" "; a$(12);" = ";c;" ";a$(5):PAUSE:GO TO 2190
1020 CLS:c=b:c=c*28.34953: PRINT b;" "; a$(13);" = ";c;" ";a$(6):PAUSE:GO TO 2190
1030 CLS:c=b:c=c*.4535924: PRINT b;" "; a$(14);" = ";c;" ";a$(7):PAUSE:GO TO 2190
1040 CLS:c=b:c=(c-32)*(5/9): PRINT b;" "; a$(15);" = ";c;" ";a$(16):PAUSE:GO TO 2190
1050 CLS:c=b:c=c*(9/5)+32: PRINT b;" "; a$(16);" = ";c;" ";a$(15):PAUSE:GO TO 2190
2000 DIM a$(16,16)
2010 a$(1) = "Centimeters"
2020 a$(2) = "Meters"
2030 a$(3) = "Cubic cenimeters"
2040 a$(4) = "Kilometers"
2050 a$(5) = "Liters"
2060 a$(6) = "Grams"
2070 a$(7) = "Kilograms"
2080 a$(8) = "Inches"
2090 a$(9) = "Yards"
2100 a$(10) = "Cubic inches"
2110 a$(11) = "Miles"
2120 a$(12) = "Gallons"
2130 a$(13) = "Ounces"
2140 a$(14) = "Pounds"
2150 a$(15) = "Degrees F"
2160 a$(16) = "Degrees C"
2170 GO TO 10
2190 INPUT\\ "Do you require another conversion? (y/N) ";d$
2200 IF d$ = "y"OR d$ = "Y" THEN GO TO 10
2210 STOP
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.