' *************************
' * Main Program *
' *************************
GOSUB A100.Initialization
GOSUB B100.Process
GOSUB C100.Wrap.Up
END
' *************************
' * Initialization *
' *************************
A100.Initialization:
CLS ' Clear Screen
H1$ = " Inflation Gauge Report"
H2$ = " Current Inflation Price"
H3$ = " Item Price rate in % in 1 Yr."
D1$ = " \ \ #,###.## ###.## #,###.##"
T1$ = "End of Report"
' **** Print Headings ******
PRINT H1$
PRINT
PRINT H2$
PRINT H3$
PRINT
RETURN
' ************************
' * Process *
' ************************
B100.Process:
READ Item$, Current.Price, Previous.Price, Number.Weeks
DO WHILE Item$ <> "EOF"
GOSUB B200.Compute
PRINT USING D1$; Item$; Current.Price; Inflation.Rate; Price.Year
READ Item$, Current.Price, Previous.Price, Number.Weeks
LOOP
RETURN
' **** Computations *******
B200.Compute:
Price.Change = (Current.Price - Previous.Price) / Number.Weeks * 52
Inflation.Rate = Price.Change / Previous.Price * 100
Price.Year = Current.Price + Inflation.Rate * Current.Price
RETURN
' ****************************
' * Wrap Up *
' ****************************
C100.Wrap.Up:
PRINT
PRINT T1$
RETURN
' ******* Data Follows *******
DATA 1 asd, .98, .84, 13
DATA 1 hgf, 1.70, 1.62, 14
DATA 1 daf, 2.20, 2.09, 17
DATA 1 hg, 1.65, 1.55, 8
DATA EOF, 0, 0, 0
' ***** End of Program ********