0 'S$AVER.BA David Dunn Thomas 1 'CLUB 100 Library - 415/939-1246 BBS, 937-5039 NEWSLETTER, 932-8856 VOICE 2 'For GEnie's Laptops RoundTable 3 'All rights reserved 4 'Further distribution MUST retain the 5 'REM lines 0 to 5. 6 CLS:PRINT@125,"Initializing ...." 7 CLEAR1000:DIMS$(9,50),P(3,50):E$=CHR$(27):R$=E$+"p":N$=E$+"q":U$="###.##":D$=STRING$(7,45):ONERRORGOTO65 8 FORI=1TO3:READS$(I,X):NEXT 9 FORJ=1TO3:FORI=1TO50:READS$(J,I):NEXT:RESTORE100:NEXT 10 CLS:PRINT@47,R$" $Saving Shopping Program "N$ 11 PRINT@130,"<1> Record prices" 12 PRINTTAB(10)"<2> The Bottom Line" 13 PRINTTAB(10)"<3> Print final report" 14 PRINTTAB(10)"<4> Exit program":PRINTTAB(11)""; 15 A$=INPUT$(1):ONVAL(A$)GOSUB18,46,36,17 16 GOTO10 17 MENU 18 CLS:PRINT@50,R$" Record Prices Section "N$:PRINT 19 FORI=1TO3 20 PRINTTAB(15);STR$(I)") ";S$(I,X) 21 NEXT 22 PRINT@281,"Which store are you pricing? "; 23 A$=INPUT$(1):S=VAL(A$):S$=S$(S,X) 24 IFS<1ORS>3THEN23 25 CLS:PRINT@42,"Enter prices for each item":PRINT@82,"as found in "R$;S$(S,X);N$" store." 26 FORI=1TO50 27 PRINT@205,S$(S,I)" "R$"cost:"N$;:INPUTP(S,I) 28 PRINT@200,E$"K" 29 T(S)=T(S)+P(S,I):NEXT 30 CLS:PRINT@85,"One moment ...":PRINT@161,"Storing those prices in "LEFT$(S$,4)".DO file." 31 OPENLEFT$(S$,4)FOROUTPUTAS1 32 FORI=1TO50 33 PRINT#1,P(S,I) 34 NEXT:PRINT#1,T(S):CLOSE 35 RETURN 36 CLS:PRINT@47,R$" Print Comparison Section "N$ 37 PRINT:PRINT" This section prints out the results of your pricing the three stores." 38 IF(INP(187)AND6)<>2THENPRINT:PRINT" However, your printer isn't hooked up!";:PRINT@300,"";:A$=INPUT$(1):RETURN 39 PRINT:PRINT" All pricing done? Ready? [y/n] ";:A$=INPUT$(1) 40 IFA$<>"Y"ANDA$<>"y"THENRETURN 41 CLS:PRINT@125,"Collecting the data .." 42 FORJ=1TO3:OPENLEFT$(S$(J,X),4)FORINPUTAS1 43 FORI=1TO50:INPUT#1,P(J,I):NEXT 44 INPUT#1,T(J):CLOSE 45 NEXT:IFA$="2"THENRETURNELSE50 46 CLS:PRINT@51,R$" The Bottom Line "N$:PRINT:PRINTTAB(5);S$(1,X);TAB(18);S$(2,X);TAB(28);S$(3,X):GOSUB42 47 PRINTTAB(5);D$;TAB(18);D$;TAB(28);D$ 48 PRINTTAB(4)T(1);TAB(17)T(2);TAB(27)T(3) 49 PRINTTAB(20)"";:A$=INPUT$(1):RETURN 50 PRINT:PRINTTAB(18)"... and printing ..." 51 LPRINT"":LPRINT"" 52 LPRINTTAB(25)"Results of Comparison Shopping" 53 S$=S$(1,X)+"/"+S$(2,X)+"/"+S$(3,X) 54 LPRINTTAB((80-LEN(S$))/2);S$ 55 LPRINT"":LPRINT"" 56 LPRINTTAB(10)"Product";TAB(37)S$(1,X);TAB(47)S$(2,X);TAB(57)S$(3,X) 57 LPRINTTAB(10)"";:FORI=1TO59:LPRINT"-";:NEXT:LPRINT"-" 58 FORI=1TO50 59 LPRINTTAB(10);S$(1,I);TAB(35);:LPRINTUSINGU$;P(1,I);:LPRINTTAB(45);:LPRINTUSINGU$;P(2,I);:LPRINTTAB(55);:LPRINTUSINGU$;P(3,I) 60 NEXT 61 LPRINTTAB(34);D$;TAB(44);D$;TAB(54);D$ 62 LPRINTTAB(34)"$";:LPRINTUSINGU$;T(1);:LPRINTTAB(44)"$";:LPRINTUSINGU$;T(2);:LPRINTTAB(54)"$";:LPRINTUSINGU$;T(3) 63 LPRINTCHR$(12) 64 RETURN 65 CLS:IFERR=52THENPRINT@41,"Oops! Best read the instructions!":PRINT:PRINT" Prices must be entered for each store before getting results.":PRINT" A .DO file for each store is created after price entry. Missing!":GOTO67 66 PRINT@41,"Error"ERR"in line"ERL:PRINT:PRINT" Tch, tch! Better notify MORTIMER!":PRINT" (after reviewing documentation.)" 67 A$=INPUT$(1):RESUME10 90 DATAGiant,Mars,Stay-Fresh 100 DATAeggs,milk,butter,margarine,bread,sugar,sweetener,cooking oil,coffee,decaf,tea,flour 101 DATAchicken (fresh),chicken (frozen),hamburger,ground round,steak,pork chops,ham,turkey 102 DATApaper towels,toilet paper,paper napkins,hand soap,dishwasher soap,liquid soap,all purpose cleanser,laundry detergent 103 DATAlettuce,cabbage,tomatoes,carrots,peas,spinach,onions,potatoes,broccoli,apples,pears,peaches,cherries,oranges,grapefruit,grapes 104 DATAcarrots (frozen),peas (frozen),spinach (frozen),broccoli (frozen),peaches (frozen),cherries (frozen)