1 REM SEASIND  
5 CLEAR  1000  
10 CLS  
20 PRINT  TAB(5); "SEASONAL INDEX FOR A TIME SERIES":PRINT   
30 PRINT "MOST BUSINESSES SHOW SEASONAL VARIATIONS OF SALES. THAT MEANS  
35 PRINT "THAT THE SALES AT ONE TIME OF THE YEAR ARE HIGHER THAN THOSE  
40 PRINT "AT OTHER TIMES YEAR AFTER YEAR. THE SEASONAL INDEX FOR A  
45 PRINT "SEASON(OR MONTH) IS THE PERCENTAGE THAT SEASON'S SALES ARE OF  
50 PRINT "THE SALES IN AN 'AVERAGE' SEASON. FOR EXAMPLE IF A STORE SELLS   
60 PRINT "$60,00 PER YEAR, OR $5,000 PER MONTH AND AVERAGES $8,000  
65 PRINT "DURING JUNE THEN THE INDEX FOR JUNE IS 160.   
70 PRINT :PRINT "THIS PROGRAM WILL COMPUTE SEASONAL INDICES. WHAT IS  
75 PRINT "NECESARY IS THE INPUT OF SALES AMOUNTS FOR EACH SEASON FOR  
80 PRINT "AT LEAST SEVERAL YEARS. THE PROGRAM WILL ACCEPT FEWER YEARS  
85 PRINT "BUT THE RESULTS WOULD BE MEANINGLESS.  
90 PRINT :INPUT "PRESS ENTER TO BEGIN";Z9$  
100 DIM  A(100,12),B(12),C(12),I(12)  
110 CLS  
120 INPUT "NUMBER OF SEASONS IN YEAR(<=12)";N  
125 IF  N>12  OR  N<1  OR  N<>INT(N)  THEN  GOSUB  10000:GOTO  120  
130 INPUT "NUMBER OF YEARS OF DATA AVAILABLE(<=100)";NY  
135 IF  NY>100  OR  NY<0  OR  NY<>INT(NY)  THEN  GOSUB  10000:GOTO  130  
140 PRINT   
145 S=0:FOR  J=1 TO 12:B(J)=0:NEXT   
150 FOR  I=1  TO  NY  
160 PRINT "DATA FOR YEAR ";I  
170 FOR  J=1  TO  N  
180 PRINT "   ENTER DATA FOR SEASON";J;:INPUT  A(I,J)  
185 B(J)=B(J)+A(I,J):REM SEASONAL TOTALS  
187 S=S+A(I,J)  
190 NEXT  J  
200 NEXT  I  
210 AV= S/(NY*N):REM AVERAGE SEASONAL SALES  
215 FOR J= 1 TO N:C(J)=B(J)/NY:NEXT:REM SEASON AVERAGE  
220 FOR J=1 TO N:I(J)=B(J)/(NY*AV):NEXT:REM RATIOS NEEDED  
300 F$(1)="SEASON        AVERAGE SALES        INDEX"  
310 F$(2)="  ##          $$#######.##         #####.##"  
330 CLS  
340 INPUT "IS LINE PRINTER OUTPUT DESIRED(Y/N)";Z2$  
350 IF  Z2$<>"Y"  AND  Z2$<>"N"  THEN  GOSUB  10000:GOTO  340  
360 IF  Z2$="Y"  THEN  INPUT "PRESS ENTER WHEN PRINTER READY";Z9$  
400 CLS:PRINT "AVERAGE MONTHLY SALES = $";INT(100*AV+.5)/100:PRINT   
405 IF  Z2$="Y"  THEN  LPRINT  "AVERAGE MONTHLY SALES = $";INT(100*AV+.5)/100:LPRINT  " "  
410 PRINT  F$(1):IF  Z2$="Y"  THEN  LPRINT  F$(1):LPRINT  " "  
420 FOR  I=1  TO  N  
430 PRINT USING  F$(2);I,C(I),I(I)  
435 IF  Z2$="Y"  THEN  LPRINT  USING  F$(2);I,C(I),I(I)  
440 NEXT   
450 PRINT :END  
10000 PRINT "INPUT ERROR! TRY AGAIN!":FOR  I=1 TO 300:NEXT :RETURN   

