1 GOTO910 2 REM ** ML STOP KEY DISABLE ** 3 PRINT"x[169]=[141][169][141]X` [234][255][169][255][133][145]L4[234]x[169]1[141][169][234][141]X` 4 [153]"xhhh+hNOThhhhhhhPRINT#HRUNHX`111" 5 [153]"hhhhhhh`1" 6 [143] ** 4 - POP ML SUBROUTINE ** 10 [143] **GENERAL INPUT ROUTINE ** 15 : 30 : 35 [143] +++ INPUT SECTION +++ 40 [151]UO,0:UR$[178]"":UI$[178]"" 42 [139]UL[178]0[167]UL[178]80 45 [153]" CMDCMD";:[151]UC,0 50 [161]UI$:[139]UI$[178]""[167]50 55 [139]UI$[178][199](13)[175][195](UR$)[177][178]1[167][151]UC,1:[153]" CMD";:[137]85 60 [139]UI$[178][199](20)[167]105 62 [139] [195](UR$)[178][177]UL[167]50 65 [141]120:[143] CHECK FOR VALID CHARACTER 70 UR$[178]UR$[170]UI$ 75 [153]UI$; 80 [137]50 85 [143] +++ CHECK FOR HELP REQUEST +++ 90 [139]UR$[178]UX$[167]195:[143] EXIT TO HELP ROUTINE 95 [139]UF[178]1[167][141]240 100 UF[178]0:[153]:[142] 102 [143] ++ CHECK DELETE ++ 105 [139][195](UR$)[179]1[167]50 110 UR$[178][200](UR$,[195](UR$)[171]1) 115 [153]"CMD CMDCMD";:[137]50 120 [143] ++ CHECK FOR VALID CHARACTERS ++ 125 [139][195](US$)[178]0[167]150 130 [129]US[178]1[164][195](US$) 135 [139]UI$[178][202](US$,US,1)[167][142] 140 [130] 145 UI$[178]"":[142] 150 [143] ** STANDARD INPUT ** 152 [139][198](UI$)[178]46[167][142] 155 [139]UI$[178][199](32)[167][142] 160 [139][198](UI$)[179]48[176][198](UI$)[177]57[167]170 165 [142] 170 [139][198](UI$)[179]65[176][198](UI$)[177]90[167]180 175 [142] 180 [139][198](UI$)[179]193[176][198](UI$)[177]218[167]UI$[178]"":[142] 185 [139][194](UT)[178]UU%[167]UI$[178][199]([198](UI$)[171]128):[142] 187 [142] 190 UI$[178]"":[142] 195 UF[178]1:[143] +++ HELP ROUTINE EXIT +++ 197 [141]250 200 [141]245 205 [129]UQ[178]UB[164](U2%[172]256[170]U1%[170]U3%[171]2) 210 UQ%(UQ[171]UB)[178][194](UQ):[130]:[153]"LOAD" 215 UZ[178]1:UV%[178][194](UT) 216 [137]300 217 UZ[178]0:US$[178]UJ$:UG$[178]UK$:UP[178]UJ:UL[178]UK 218 [139][194](50003)[178]0[167][151]53281,1:[153]"LOAD";:[151]53281,6:[151]53280,14:[137]220 219 [153]"LOAD"; 220 UT$[178]UL$:[151]UT,UV%:[129]UQ[178]UB[164](U2%[172]256[170]U1%[170]U3%[171]3) 225 [151]UQ,UQ%(UQ[171]UB):[130] 230 [151]U1,U1% 232 [151]U2,U2% 233 [151]U4,U4% 234 [151]U3,U3%[171]1 235 [137]35 240 UD%[178]((U2%[172]256[170]U1%[170]U3%)[171]UB)[173]40:[153][200](UD$,UD%[170]1):[142] 245 [153][200](UD$,24);"  HELP COMING WAIT ":[142] 250 U1%[178][194](U1):U2%[178][194](U2):U3%[178][194](U3):U4%[178][194](U4) 251 UJ$[178]US$:UK$[178]UG$:UL$[178]UT$:UJ[178]UP:UK[178]UL 255 [142] 300 [143] ** MENU ** 301 : 302 [153]"LOAD":[151]UT,UU%:[139][194](50003)[178]0[167][151]53281,9:[151]53280,8 303 : 305 [153]" MENU" 310 [153]" --------------------------------------" 315 [153]" 1. BEGIN LEMONADE 320 PRINT" 2. STUDENT INSTRUCTIONS" 325 PRINT" 3. TEACHER INSTRUCTIONS" 335 PRINT" 4. QUIT" 340 PRINT" --------------------------------------" 345 PRINT" PRESS A NUMBER KEY (1-4) "; 350 UL=1:US$="1234":GOSUB35:REM INPUT ROUTINE 352 US$="" 355 ONVAL(UR$)GOSUB1000,400,500,396 360 GOTO300 395 REM ** RE-ENABLE STOP KEY AND END ** 396 IFPEEK(50003)<>1ANDPEEK(50003)<>160ANDPEEK(50003)<>0THEN399 397 SYSUU+71:IFPEEK(50003)=0THENPOKE53281,6:POKE53280,14 398 PRINT"[154][147]":END 399 GOSUB875:RETURN 400 REM ** STUDENT INSTRUCTIONS ** 405 PRINT"[147]":POKEUT,UL%:IFPEEK(50003)=0THENPOKE53281,0:POKE53280,0 410 UP=0:UG$="[211]TUDENT [201]NST":GOSUB850 411 GOSUB2680 485 GOSUB835 490 IFUZ=1THENSYSUP%:GOTO217 499 RETURN 500 REM ** TEACHER INSTRUCTIONS ** 501 PRINT"[147]":POKEUT,UL%:IFPEEK(50003)=0THENPOKE53281,2:POKE53280,10 502 UP=0:UG$="[212]EACHER [201]NST":GOSUB850 503 PRINT" [212]O THE BEST OF OUR KNOWLEDGE," 504 PRINT" THIS PROGRAM IS IN THE PUBLIC" 505 PRINT" DOMAIN. [201]F THIS IS NOT THE CASE" 506 PRINT" PLEASE CONTACT:" 507 PRINT" [195]OMMODORE [194]USINESS [205]ACHINES" 508 PRINT" 3370 [208]HARMACY [193]VE. 509 [153]" ATNGINCOURT, (null)NTARIO" 510 [153]" LENANADA (null)1(null) 2(null)4" 511 [153]" (416) 499-4292" 512 UP[178]1:[141] 835:[141] 850: 513 [153]" (null)ROGRAM (null)AME: (null)EMONADE  514 PRINT" [215]RITTEN [194]Y : [213]NKNOWN 515 [153]" (null)PGRADED PEEKY :  516 PRINT" [212]HIS PROGRAM WILL RUN ON ANY 519 [153]" (null)VAL(null) 64 LEN(null)(null)(null)(null)(null)VAL(null) 520 PRINT" [195][207][205][205][207][196][207][210][197] 64 [195][207][205][208][213][212][197][210] 521 [141]835 590 [139]UZ[178]1[167][158]UP%:[137]217 599 [142] 600 [143] ** PROGRAM MODIFICATION INST ** 601 [153]"LOAD":[151]UT,UL% 605 UP[178]0:UG$[178]"(null)ROGRAM (null)OD":[141]850 660 [141]835 690 [139]UZ[178]1[167][158]UP%:[137]217 699 [142] 700 [143] ** TO USE 8032 LOAD CBM4032 ** 710 [153]"LOADBEFORE RUNNING THIS PROGRAM ON AN 8032  720 PRINT" LOAD THE 'CBM 4032' PROGRAM" 730 SYSUU+71 740 END 800 REM ** T I T L E P A G E ** 802 PRINT"[147]";:POKEUT,UU%:IFPEEK(50003)=0THENPOKE53280,14:POKE53281,6 804 FORI=1TO38:PRINT"[166][146]";:NEXT 806 FORI=1TO22:PRINT"[157][166][146]";:NEXT 808 FORI=1TO37:PRINT"[157][157][166][146]";:NEXT 810 FORI=1TO22:PRINT"[145][157][166][146]";:NEXT 812 PRINT"[169] [146] 814 [153]" WAIT  WAITSTEP 816 PRINT" [146] [163][223] 818 [153]"(null) WAIT 820 PRINT"C O M M O D O R E 822 [153]"EDUCATIONAL 824 PRINT"SOFTWARE 826 [143] ** COMMODORE LOGO ** 827 [153][200](UD$,24);"PRESS SPACE BAR OR WAITWAIT":I[178]0 828 [161]A$:[139]A$[179][177]" "[167]I[178]I[170]1:[139]I[179]250[167]828 830 T1$[178]"":T2$[178]"":T3$[178]"":T4$[178]"":I[178]0 832 [137]300 835 [143] ** SPACE BAR PRESS ** 840 [151]UO,0:[153][200](UD$,24);"PRESS SPACE BAR TO CONTINUEWAIT" 844 [161]UI$:[139]UI$[179][177]" "[167]844 846 [142] 850 [143] ** PAGE DESIGN ROUTINE ** 852 UP[178]UP[170]1 855 [153]"LOAD"[200](UT$[170]UP$,21);[201](UP$[170]UG$[170][196](UP),18) 860 [153]" --------------------------------------" 864 [139]UH[179][177]0[167]870 865 [153][200](UD$,24);[200](UP$,7);"HELP - PRESS H " 870 UH[178]0:[153]"":[142] 875 [143] ** PLEASE WAIT REMARK ** 880 [153][200](UD$,24);" ONE MOMENT PLEASE... " 885 [142] 900 [143] ** SET UP VARIABLES ** 901 UX$[178]"H":[134]UQ%(1000):UB[178]32768:U1[178]196:U2[178]197:U3[178]198:U4[178]216:UC[178]167:UU[178]1024 902 UT[178]59468:UU%[178]12:UL%[178]14:UP%[178]1146:UM[178]32768:UO[178]158:[151] 50003,0 903 [139][194](50003)[178]0[167]UB[178]1024:U1[178]209:U2[178]210:U3[178]211:U4[178]214:UC[178]204:UU[178]2048 904 [139][194](50003)[178]0[167]UT[178]53272:UU%[178]21:UL%[178]23:UP%[178]2139:UM[178]1024:UO[178]198 905 UD$[178]"" 906 UP$[178]" " 907 UT$[178]" (null)EMONADE CLOSECLOSECLOSECLOSECLOSE":[143] PLACE PROGRAM TITLE HERE !!!!!!!!!!!!!!!!!*** 908 WK[178]10: [142] 910 [143] ** SET VARIABLES ** 915 [141]900 920 [143] ** CHECK FOR 8032 ** 925 [153]"LOAD":[153]"CLOSE":[143] SHIFTED SPACE 930 [139][194](UB[170]40)[179][177]96[167][141]700 931 [143] ** MEMORY CHECK ** 932 [139] [184](0)[177]2000[167]937 933 [153]"LOADTHIS MACHINE DOES NOT HAVE ENOUGH" 934 [153]"MEMORY TO RUN THIS PROGRAM !" 935 [158]UU[170]71 936 [128] 937 [153]"LOAD":[139][194](50003)[178]0[167]962 940 [143] ** BASIC 2.0 OR 4.0 OR C-64 SETUP ** 941 [151]1075,133:[151]1076,144:[151]1077,234:[151]1079,4:[151]1080,133:[151]1081,145 942 [151]1091,155:[151]1098,133:[151]1099,144:[151]1100,234:[151]1103,133 943 [151]1104,145:[151]1105,234:[151]1082,234 945 [139][194](50003)[179][177]160[167]955 950 [151]1093,88:[151]1094,228:[151]1097,85:[151]1102,228:[137]965 955 [139][194](50003)[179][177]1[167]990 960 [151]1093,49:[151]1094,230:[151]1097,46:[151]1102,230:[137]965 962 [151]2099,141:[151]2100,20:[151]2101,3:[151]2103,8:[151]2104,141:[151]2105,21 963 [151]2106,3:[151]2115,145:[151]2117,52:[151]2118,234:[151]2121,49:[151]2122,141 964 [151]2123,20:[151]2124,3:[151]2126,234:[151]2127,141:[151]2128,21:[151]2129,3 965 [158]UU[170]48:[143] DISABLE STOP KEY 970 [141]800:[143] TITLE 980 [137]300:[143] MENU 990 [153]"LOADTHE PGM WILL NOT WORK ON THIS MACHINE!":[128] 1000 [139]UZ[178]1[167][158]UP%:[158]UP%:UZ[178]0:[143] ** PROGRAM STARTS HERE ** 1001 [153]"LOAD";:[140]:[139][194](50003)[178]0[167][151]53281,6:[151]53280,6 1002 UG$[178]"" 1070 UG$[178]"WELCOME":UP[178]0:UH[178]1:[141]850 1095 [137]1140 1140 [153]" YOUR NAME? ";:UL[178]13:US$[178]"": [141]35:A$[178]UR$ 1150 A$[178][200](A$,13) 1151 UP[178]1:UG$[178]"DURATION":[141]850 1155 [153]" "A$ ", YOU SHALL OPERATE YOUR":[153]" STAND FOR"WK"WEEKS." 1156 [141]835 1160 B[178]10:D1[178]0:A1[178]0:P1[178]0:X[178]1 1170 FX[178]0:[141]2430:[141]2940 1180 [153]""[200](UT$[170]UP$,15);[201](UP$[170]UG$[170][196](X),24) 1190 [153]:[153][163]23)"PREDICTION FORCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDSATURDAY:" 1200 [153][163]23)"TEMPERATURES INCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDTHE"T"CMD'S AND" 1210 [153]"CMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMD"H$" HUMIDITY" 1220 [141]3130 1230 [141]3090 1240 [153]"1WAIT SUGAR IS $"S"FOR A 5-KILO BAG." 1250 [153]"HOW MANY BAGS DO YOU WANT TO BUY? ";:[141]3230:A[178]ANS 1260 [139]A[172]S[179]B[137]1310 1270 [141]3090:[153]"YOU DON'T HAVE ENOUGH MONEY":[153]"FOR"A"BAGS." 1280 [141]835:[141]865 1300 [137]1230 1310 B[178]B[171](A[172]S):A1[178]A1[170](5[172]A) 1320 [139]FX[178]2[167][141]3090:[141]3130:[137]1630 1330 [141]3130 1340 [141]3090 1350 [153]"2WAIT CONC. LEMON JUICE IS $"L"A LITRE." 1360 [153]"HOW MANY BOTTLES DO YOU WANT TO BUY? ";:[141]3230:D[178]ANS 1370 [139]D[172]L[179]B[137]1420 1380 [141]3090:[153]"YOU DON'T HAVE ENOUGH MONEY":[153] "FOR"D"BOTTLES." 1390 [141]835:[141]865 1410 [137]1340 1420 B[178]B[171](D[172]L):D1[178]D1[170]D 1430 [139]FX[178]2[167][141]3090:[141]3130:[137]1630 1440 [141]3130 1450 [141]3090 1460 [153]"3WAIT CUPS ARE $"C"FOR A BAG OF 100." 1470 [153]"HOW MANY BAGS DO YOU WANT TO BUY? ";:[141]3230:P[178]ANS 1480 [139]P[172]C[179]B[137]1530 1490 [141]3090:[153]"YOU DON'T HAVE ENOUGH MONEY":[153]"FOR"P"BAGS." 1500 [141]835:[141]865 1520 [137]1450 1530 B[178]B[171](P[172]C):P1[178]P1[170](P[172]100) 1540 [141]3130 1550 [141]3090 1560 [139]FX[178]2[167][141]3090:[141]3130:[137]1630 1570 [153]""; 1580 [129]V[178]1[164]8 1590 [153][163]23)" " 1600 [130]V 1610 [153]""[163]23)"TEMPERATURE:"Z[170]T 1620 [153][163]23)"WET BULB :"T2 1630 [153]"DO YOU WANT TO CHANGE ANY " 1640 [153]"OF THE ITEMS? ";:UL[178]1:US$[178]"YN":[141]35:[139]UR$[178]"N"[167]1710 1650 FX[178]2 1660 [153]"WHICH ITEM: SUGAR=1 LEMON=2 CUPS=3" 1664 [153]"ENTER 1WAIT, 2WAIT OR 3WAIT: CMDCMDCMDCMDCMDCMD"; 1665 US$[178]"123":UL[178]1:[141]35:ANS[178][197](UR$) 1670 [139]ANS[178]3[167]B[178]B[170](P[172]C):P1[178]P1[171](P[172]100):[137]1440 1680 [139]ANS[178]4[167]231 1690 [139]ANS[178]2[167]B[178]B[170](D[172]L):D1[178]D1[171]D:[137]1330 1700 B[178]B[170](A[172]S):A1[178]A1[171](5[172]A):[137]1220 1710 [153]"PRICE (IN CENTS) FOR A CUP" 1715 [153]"OF LEMONADE: CMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMD"; 1720 [141]3230:K[178]ANS 1730 [141]3090 1740 F3[178]3[171]((K[173]3)[173]((((T[170]Z[170]T2)[171]37.5)[174]3)[173]10[174]6)) 1750 [139]F3[179]0[167]F3[178]0 1760 [153]""K 1765 [143] 1770 F1[178][181](F2[172]F3[172]F4) 1780 [139]F1[179]0[167]F1[178]0 1790 [139]F1[179]1[167]W[178]1:[139]F1[179]1[137]1970 1800 [141]2300 1810 [139]W[178]F1[137]1980 1820 [139]P1[177]0[137]1870 1830 [141]3090 1840 [153]"YOU WOULD HAVE MADE"F1"SALES,":[153]"IF YOU HAD MORE CUPS." 1850 TT[178]TI[170]300:FX[178]1 1860 [139]TT[177]TI[137]1860 1870 [141]3090 1880 [139]D1[177]0[137]1920 1890 [153]"YOU WOULD HAVE MADE"F1"SALES,":[153]"IF YOU HAD MORE LEMON JUICE." 1900 TT[178]TI[170]300:FX[178]1 1910 [139]TT[177]TI[137]1910 1920 [141]3090 1930 [139]A1[177]0[137]1970 1940 [153]"YOU WOULD HAVE MADE"F1"SALES,":[153]"IF YOU HAD MORE SUGAR." 1950 TT[178]TI[170]300:FX[178]1 1960 [139]TT[177]TI[137]1960 1970 [141]3090 1980 [153]"YOU MADE"W[171]1"SALES AT"K"CENTS A CUP." 1990 [153]"YOU GROSSED $"(W[171]1)[172](K[173]100)"CMD." 2000 [129]K1[178]1[164]50 2010 F5[178]3[171]((K1[173]3)[173]((((T[170]Z[170]T2)[171]37.5)[174]3[173]10[174]6))) 2020 G5[178]([181](F5[172]F2[172]F4))[172](K1[173]100) 2030 [139]G5[179]G9[137]2060 2040 G9[178]G5 2050 K9[178]K1 2060 [130]K1 2070 [139]K9[178]K[137]2120 2080 [141]3090 2090 [153]"YOU COULD HAVE GROSSED $"G9"TODAY," 2100 [153]"IF YOU HAD CHARGED"K9"CENTS." 2110 [137]2150 2120 [141]3090 2130 [153]K"CENTS WAS THE BEST PRICE FOR TODAY." 2140 [139]FX[179][177]1[167][153]"YOU'RE A GOOD BUSINESSMAN.":COUNT[178]COUNT[170]1 2150 K9[178]0:G9[178]0 2160 TT[178]TI[170]300 2170 [139]TT[177]TI[137]2170 2180 X[178]X[170]1:[139]X[179][178]WK[167]1170 2190 UP[178]1:UG$[178]"(null)UMMER'S VALND":[141]850:[151]UT,UL%:[153]" (null)HE SUMMER IS OVER." 2200 [153]"(null)OU HAVE $"B"CMD." 2210 [153]" (null)OU OWE YOUR FAMILY $10, SO":[153]" YOU EARNED $"B[171]10"THIS SUMMER. 2220 PRINT" [217]OU HAVE"P1"CUPS,"INT(D1)"BOTTLES OF" 2225 PRINT" LEMON JUICE AND"INT(A1)"KILOGRAMS OF " 2226 PRINT" SUGAR LEFT OVER." 2240 IFCOUNT.66THENH$="HIGH" 2970 IFH<.33THENH$="LOW" 2980 IFH>.32ANDH<.67THENH$="AVERAGE" 2990 S=.99+(.01)*INT(RND(TI)*9):REM**COST OF SUGAR 3000 L=.69+(.01)*INT(RND(TI)*9):REM**COST OF CONCENTRATE 3010 C=.90+(.01)*INT(RND(TI)*9):REM**COST OF CUPS 3020 Z=-5+INT(RND(TI)*20) 3030 T2=T+Z-INT(H*10) 3040 F2=INT(RND(TI)*30)+70 3050 F4=(((T+Z+T2)-137.5)/25) 3060 IFF4<.1THENF4=.1 3070 IFF4>1THENF4=1 3080 RETURN 3090 PRINTLEFT$(UD$,21)UP$ 3100 PRINTLEFT$(UD$,22)LEFT$(UP$,39) 3110 PRINTLEFT$(UD$,21); 3120 RETURN 3130 FORU=1TO6 3140 IFMID$(STR$(B),U,1)="."GOTO3170 3150 NEXTU 3160 GOTO3180 3170 B=VAL(LEFT$(STR$(B),U+2)) 3175 B=INT(B*100)/100 3180 PRINT""TAB(27)" [157][157][157][157][157][157]";:GOSUB60000:PRINTU6$ 3190 PRINTTAB(25)" [157][157][157][157][157]"INT(A1) 3200 PRINTTAB(25)" [157][157][157][157][157]"INT(D1) 3210 PRINTTAB(25)" [157][157][157][157][157]"P1 3220 RETURN 3230 US$="0123456789H":UL=2:GOSUB35:ANS=VAL(UR$):RETURN 5000 PRINT" [195]ERTAIN INFORMATION ABOUT THE COSTS" 5010 PRINT" OF COMPONENTS REQUIRED FOR YOUR 5020 [153]" LEMONADE WILL BE DISPLAYED AT THE " 5030 [153]" BOTTOM OF THE SCREEN." 5040 [153]" RIGHT$T IS UP TO YOU TO DECIDE HOW MUCH OF" 5050 [153]" EACH OF THESE COMPONENTS YOU WISH" 5060 [153]" TO BUY, DEPENDING ON THE MARKET 5070 PRINT" OUTLOOK FOR THE DAY. " 5075 GOSUB835 5080 REM 5090 REM 5095 REM 5100 GOSUB850 5500 REM 5510 PRINT" [198]INALLY..." 5520 PRINT" [196]ON'T ALWAYS RELY ON THE WEATHER" 5530 PRINT" FORECAST. [201]T COMES FROM [197]NVIRONMENT" 5540 PRINT" [195]ANADA, AND YOU KNOW WHAT THAT MEANS. 5550 [153]" RIGHT$T WOULD BE WISE TO CHECK THE " 5560 [153]" ACTUAL TEMPERATURES AND THEN MAKE ANY" 5570 [153]" CHANGES IN YOUR PURCHASES, BASED ON":[153]" THAT INFORMATION." 5580 [141]835:[142] 60000 U6[178][182](B)[170]1:U7[178][181](U6) 60005 U7[178][181](U6):U6$[178][196](U7[171]1)[170]"."[170][202]([196](U6)[170]"00000",[195]([196](U7))[170]2,2) 60010 [142]