1 3REM S A V I N G
2 4REM
3 10 PRINT"SAVING"
4 100 PRINT
5 110 PRINT " THIS PROGRAM CALCULATES THE AMOUNT OF MONEY THAT"
6 120 PRINT "WOULD ACCUMULATE AFTER N YEARS AT AN ANNUAL INTEREST"
7 130 PRINT "RATE R COMPOUNDED T TIMES PER YEAR, WHEN THE INITIAL"
8 140 PRINT "AMOUNT IS P AND AN AMOUNT D IS ADDED AT THE BEGINNING"
9 150 PRINT "OF EACH SUBSEQUENT YEAR. NOTE THAT P AND D ARE GIVEN"
10 160 PRINT "IN DOLLARS, N AND T MUST BE INTEGERS, AND R IS GIVEN"
11 170 PRINT "AS A PERCENTAGE."
12 180 PRINT
13 190 PRINT "WHAT ARE P,D,N,T,R";
14 200 INPUT L,N,Y,X,A
15 210 IF X<>0 THEN 250
16 220 PRINT
17 230 PRINT "X MUST NOT EQUAL ZERO..."
18 240 GOTO 180
19 250 LET D=0
20 260 LET B=.01*A
21 270 LET S=L
22 280 LET D=0
23 290 LET S=L
24 300 FOR Z=1 TO Y
25 310 LET S=S+D
26 320 FOR W=1 TO X
27 330 LET S=S*1+B/X
28 340 NEXT W
29 350 LET D=N
30 360 NEXT Z
31 370 PRINT
32 380 PRINT " AFTER ";Y;"YEARS, ";L;"DOLLARS INVESTED AT";A
33 390 PRINT " PERCENT COMPOUNDED ";X;"TIMES PER YEAR, WITH THE"
34 400 PRINT " ADDITION OF ";N;"DOLLARS PER YEAR, YIELDS A TOTAL"
35 410 PRINT " OF ";S;"DOLLARS."
36 420 PRINT
37 430 PRINT "MORE DATA 1=YES0=NO";
38 440 INPUT I
39 450 IF I=1 THEN 190
40 9999 END