10 DEFINT A:KEY OFF:'7/11/82 ELECTRIC
30 'WRITTEN BY  MAURY SHULMAN  265 BOWMAN AVE  MERION PA 19066
50 DIM A(1000)
90 CLS
100 PRINT"ELECTRIC BILL ANALYSIS PROGRAM":PRINT:PRINT:PRINT
200 PRINT:PRINT"ENTER FUNCTION DESIRED.":PRINT
300 PRINT:PRINT:PRINT"1.   NEW BILL ENTRY."
400 PRINT:PRINT:PRINT"2.   YEARLY ANALYSIS."
500 PRINT:PRINT:PRINT"3.   MONTHLY ANALYSIS."
600 PRINT:PRINT:PRINT"4.   SAVE PROGRAM ON DISKETTE."
700 LOCATE 24,1:INPUT Z:IF Z>4 OR Z<1 THEN BEEP:LOCATE 22,1:PRINT"INCORRECT ENTRY.  ENTER 1,2,3 OR 4.":FOR A=1 TO 3000:NEXT:BEEP:GOTO 90
800 ON Z GOSUB 2000,10000,15000,20000
900 GOTO 90
1070 INPUT "ENTER YEAR OR 0 TO END";Y
2000 CLS:PRINT"ENTER DATA IN FORM OF MMYY,KWH,$,NO OF MONTHS IN THE BILLING PERIOD":PRINT:PRINT"MMYY IS THE DATE OF THE END OF THE BILLING PERIOD":PRINT"KWH  IS THE NUMBER OF KILOWATT-HOURS BILLED":PRINT"$    IS THE TOTAT CHARGE IN CENTS (WITHOUT DECIMAL
2100 PRINT"N    IS THE MONTHS IN THE BILLING PERIOD (USUALLY ONE)":PRINT:PRINT:PRINT"BILLING DATA IS STORED WITHIN THE PROGRAM IN THE FORM OF DATA STATEMENTS.":PRINT"MAKE SURE THAT YOU SAVE THIS PROGRAM AFTER EACH TIME THAT YOU ENTER DATA."
2200 PRINT"THIS CAN BE DONE BY USING THE END FUNCTION OF THIS PROGRAM."
2300 PRINT:PRINT"THIS PROGRAM IS SET UP FOR THE YEARS 1973 TO 1984. OTHER YEARS CAN BE ANAYZED BY CHANGING THE FOLLOWING LINE NUMBERS:":PRINT"  10100 10200 10700"
2500 PRINT:INPUT "PRESS ENTER FOR LISTING OF DATA STATEMENTS";R$:LIST 30000-
4000 P=1
4002 IF S THEN RETURN
4003 S=-1
4005 RESTORE
4010 FOR Z=1 TO 100:LOCATE 24,1:PRINT"C A L C U L A T I N G";
4020 FOR W=1 TO 4
4030 READ A(P)
4040 P=P+1
4050 NEXT
4060 IF A(P-1)<=1 THEN GOTO 4200
4070 F=P-1
4080 FOR V=1 TO A(F)-1
4090 A(P)=A(F-3)+V*100
4100 IF A(P)>=1300 THEN A(P)=A(P)-1199
4110 A(P+1)=A(F-2)/A(F)
4120 A(P+2)=A(F-1)/A(F)
4130 A(P+3)=A(F)
4140 P=P+4
4150 NEXT
4160 A(F-2)=A(F-2)/A(F)
4170 A(F-1)=A(F-1)/A(F)
4200 LOCATE 24,1:PRINT"                     ";: NEXT
4300 RETURN
10000 GOSUB 4000
10100 LOCATE 24,1:INPUT "WHAT YEAR DO YOU WANT ANALYZED YYYY";Y:CLS:IF Y>1984 OR Y<1973 THEN BEEP:PRINT"INCORRECT ENTRY. ENTER A YEAR BETWEEN 1973 AND 1984.":FOR AX=1 TO 3000:NEXT:BEEP:GOTO 10100
10200 N=Y-1973:K=0:D=0:U=0:X=0:KW=0:DD=0:RD=0
10220 PRINT"ELECTRIC BILL ANALYSIS":PRINT:PRINT"DATE KW-HRS $/MONTH CENTS/KW-HR     KW %    $ %   RATE % ": PRINT
10300 FOR Q=1 TO 12
10400 M=48*N+4*(Q-1)
10430 IF A(M+2)<>0 THEN X=X+1:C=A(M+3)/A(M+2)ELSE C=0
10500 PRINT USING "####";A(M+1);:PRINT USING "######.##";A(M+2);A(M+3)/100;C;:IF KW>0 AND A(M+2)>0 THEN PRINT USING "########";(A(M+2)-KW)*100/KW;(A(M+3)-DD)*100/DD;(C-RD)*100/RD ELSE PRINT
10550 K=K+A(M+2):D=D+A(M+3)/100:U=U+C:KW=A(M+2):DD=A(M+3):RD=C
10600 NEXT
10650 PRINT:PRINT:PRINT"TOTAL";:PRINT USING "#####.##";K;:PRINT USING "######.##";D:PRINT:PRINT"AVG ";:PRINT USING "######.##";K/X;D/X;U/X
10700 LOCATE 24,1:INPUT "ENTER YEAR YYYY OR 0 TO END";Y:CLS:IF (Y>1984 OR Y<1973) AND Y<>0 THEN BEEP:PRINT"INCORRECT ENTRY. ENTER A YEAR BETWEEN 1973 AND 1984 OR 0 TO END.":FOR AX=1 TO 3000:NEXT:BEEP:GOTO 10700
10800 IF Y<>0 THEN GOTO 10200
10900 RETURN
15000 GOSUB 4000
15100 INPUT "WHAT MONTH DO YOU WANT ANALYZED? ENTER NUMBER...";N:IF N>12 OR N<1 THEN BEEP:PRINT:PRINT"INCORRECT INPUT. ENTER A NUMBER FROM 1 TO 12.":FOR AS=1 TO 3000:NEXT:BEEP:GOTO 15100
15125 CLS:KW=0:DD=0:RD=0
15130 PRINT"ELECTRIC BILL ANALYSIS":PRINT:PRINT"DATE KW-HRS $/MONTH CENTS/KW-HR     KW %    $ %   RATE % ": PRINT
15150 FOR Q=1 TO 12
15200 M=4*(N-1)+1+48*(Q-1)
15250 IF A(M+1)<>0 THEN C=A(M+2)/A(M+1)ELSE C=0
15300 PRINT USING "####";A(M);:PRINT USING "######.##";A(M+1);A(M+2)/100;C;:IF KW>0 AND A(M+1)>0 THEN PRINT USING "########";(A(M+1)-KW)*100/KW;(A(M+2)-DD)*100/DD;(C-RD)*100/RD ELSE PRINT
15400 KW=A(M+1):DD=A(M+2):RD=C:NEXT
15500 LOCATE 24,1:INPUT " NUMBER OF MONTH OR 0 TO STOP";N:IF N>12 OR N<0 THEN BEEP:PRINT"INCORRECT ENTRY. ENTER A NUMBER FROM 0 TO 12.":FOR AX=1 TO 3000:NEXT:BEEP:GOTO 15500
15600 IF N<>0 THEN GOTO 15125
15700 RETURN
20000 D$="B:ELECTRIC":DB$="B:ELECTRIC.SAV":CLS:PRINT"THIS FUNCTION WILL SAVE THIS PROGRAM ON DISKETTE":PRINT:PRINT"DEFAULT PRIMARY FILE NAME IS ";D$:PRINT"BACKUP FILE NAME IS ";DB$:INPUT "ENTER FILE NAME OR  FOR DEFAULT";R$:IF R$=""THEN R$=D$
20100 INPUT "ENTER BACKUP FILE NAME OR  FOR DEFAULT";RR$:IF RR$=""THEN RR$=DB$:PRINT:PRINT"FILE NAME IS        ";R$:PRINT"BACKUP FILE NAME IS ";RR$:PRINT:INPUT "IS THIS CORRECT REPLY Y OR N";RC$:IF RC$<>"Y" OR RC$<>"Y" THEN GOTO 20000
20200 SAVE R$:SAVE RR$:PRINT"PROGRAM SAVED.":GOTO 100
30000 DATA 173,1535,5369,3,473,1573,5647,3,773,3538,12472,3
30010 DATA 1073,1635,6020,3,174,1545,6410,3,474,1559,7806,3
30020 DATA 774,2876,13476,3,1074,1480,7418,3,175,1459,7948,3
30030 DATA 475,2209,11356,3,775,2668,14158,2,975,1112,5677,2
30040 DATA 1175,1404,7113,2,176,1278,6601,2,376,1433,7277,2
30050 DATA 576,1879,9621,2,776,2078,11348,2,976,1252,6565,2
30060 DATA 1176,1384,7295,2,177,1326,7376,2,377,1068,6105,2
30070 DATA 577,1457,8243,2,777,2693,16106,2,977,804,4644,1
30080 DATA 1077,599,3147,1,1177,802,4194,1,1277,844,4521,1
30090 DATA 178,739,4134,1,278,720,4125,1,378,746,4237,1
30100 DATA 478,545,3084,1,578,594,3278,1,678,951,5618,1
30110 DATA 778,1208,7212,1,878,1453,8617,1,978,754,4311,1
30120 DATA 1078,706,3778,1,1178,717,3874,1,1278,875,4669,1
30130 DATA 179,799,4279,1,279,820,4402,1,379,630,3658,1
30140 DATA 479,656,3789,1,579,753,4335,1,679,645,4220,1
30150 DATA 779,1139,7504,1,879,952,6547,1,979,844,6015,1
30160 DATA 1079,579,4320,1,1179,679,5220,1,1279,620,4933,1
30170 DATA 180,651,5149,1,280,774,5638,1,380,632,4651,1
30180 DATA 480,545,4046,1,580,626,4717,1,680,646,4993,1
30190 DATA 780,1351,11223,1,880,1001,8176,1,980,761,6083,1
30220 DATA 1080,624,4764,1,1180,727,5552,1,1280,660,5113,1
30230 DATA 181,636,4926,1,281,594,4599,1,381,614,4755,1
30240 DATA 481,631,5056,1,581,600,5168,1,681,735,6595,1
30250 DATA 781,1256,11697,1,881,738,6624,1,981,697,6214,1
30260 DATA 1081,659,5665,1,1181,665,5717,1,1281,711,6182,1
30270 DATA 182,646,5614,1,282,641,5571,1,382,670,5825,1
30280 DATA 482,572,4700,1,582,612,5413,1,682,660,6448,1
31000 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,00,0,00,0,0
31100 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,00,0,00,0,0
31200 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,00,0,00,0,0
31300 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,00,0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