# Compucolor.org – Virtual Media

Listing of file='ANNUIT.BAS;01' on disk='vmedia/chip_57-sector.ccvf'

```2 REM  ANNUITY CALCULATION PROGRAM
3 REM
4 REM  WRITTEN BY JOE CHARLES, 130 SHERWOOD DR, HILTON, NY 14468
5 REM  DATE OF  LATEST REVISION BY AUTHOR: 1/2/82
6 REM
7
10 DIM SUM(30),A(30),M(30),MS(30),MY(30),D(30),PV(30)
20 REM
21 PLOT 12,29
24 PRINT "THIS PROGRAM CALCULATES THE VALUE OF AN ANNUITY EACH YEAR FOR "
28 PRINT "30 YEARS. IT TAKES INTO ACCOUNT BOTH THE INTEREST RATE AND THE"
32 PRINT "INFLATION RATE. IT ASSUMES THAT YOU INCREASE YOUR INVESTMENT"
36 PRINT "EACH YEAR BY THE INFLATION RATE. IT ACTUALLY STARTS A NEW"
40 PRINT "ANNUITY EACH YEAR, SO IT ACTUALLY SUMS THE RESULTS OF 30 ANNUI-"
44 PRINT "TIES. IT ALSO RELATES VALUES TO TODAY'S DOLLAR."
48 REM
70 PLOT 12
89 REM
90 INPUT  "INITIAL AMOUNT OF ANNUITY? ";M
91 REM
92 M(0)= M
100 INPUT "INTEREST RATE? ";I:INPUT "INFLATION RATE ?";IR
105 PRINT
110 I= I/ 100:IR= IR/ 100
120 PRINT "IF YOUR INCOME KEEPS UP WITH INFLATION AND YOU EARN"
130 PRINT "\$10,000 PER YEAR NOW, YOU'LL EARN"
135 PRINT "\$";10000* (1+ IR)^ 30;" PER YEAR  IN 30 YEARS."
140 PRINT
198 FOR X= 10TO 1500:NEXT X
199
200 REM  ...CALC NEW AMOUNTS
205 MY(0)= M(0):MS(0)= M(0)
210 FOR J= 1TO 30
215 M(J)= MY(J- 1)* IR
220 MY(J)= MY(J- 1)+ M(J)
230 MS(J)= MS(J- 1)+ MY(J)
240 NEXT  J
950 PLOT 12,27,24,6,3
960  PRINT  "YEAR  VALUE    = \$1 (NOW)  AMT. INV.  NORM. VALUE "
970 PLOT 6,2
1000 FOR K= 0TO 30
1002 PLOT  6,3:PRINT  K;
1004 FOR J= 0TO K- 1
1030 A(J)= M(J)* ((1+ I)^ (K- J+ 1)- 1)/ I
1032 SUM(K)= SUM(K)+ A(J):NEXT  J
1035 D(K)= (1+ IR)^ K
1040 PLOT  6,5:PRINT  TAB( 6);SUM(K);TAB( 17);D(K);TAB( 26);MS(K);TAB( 37);SUM(K)/ D(K)
1090 NEXT K
1092 Z1= SUM(30):Z2= MS(30):Z3= D(30):Z4= Z1/ Z3
1095 PLOT 3,64,0:FOR I= 0TO 2500:NEXT I
1100 PLOT 6,2,12,27,24
2000 SC= 0.434* LOG (SUM(K- 1)):SI= INT (SC):SD= SC- SI
2020 IF  (SD> 0.90309) THEN  SC= SI+ 1 :GOTO  2200
2040 IF  (SD> 0.778151) THEN  SC= SI+ .90309 :GOTO  2200
2060 IF  (SD> 0.60206) THEN  SC= SI+ .778151 :GOTO  2200
2080 IF  (SD> 0.30103) THEN  SC= SI+ .60206 :GOTO  2200
2100 IF  (SD> 0.) THEN  SC= SI+ .30103 :GOTO  2200
2200 MX= 10.^ SC
2210 FOR I= 0TO 5:VA(I)= 10^ (SC- SI)* (5- I)/ 5:NEXT I
2220 FOR  K= 0 TO  30
2230 PV(K)= 12+ 100* SUM(K)/ D(K)/ MX
2240 SUM(K)= 12+ 100* SUM(K)/ MX
2260 D(K)= 12+ 100* D(K)/ MX
2280 MS(K)= 12+ 100* MS(K)/ MX
2300 NEXT  K
2320 PLOT 6,4, 2,246,8,18,112,250,18,8,110,255
2340 PLOT  6,4, 2:FOR  I= 35 TO  110 STEP  15:PLOT  246,8,I,112:NEXT  I
2360 FOR  I= 12 TO  112 STEP  10:PLOT  250,18,I,110:NEXT  I:PLOT  255
2380 PLOT 15,6,3:FOR I= 28TO 3STEP - 5:PLOT 3,5,I:PRINT VA((I- 3)/ 5):NEXT I
2390 PLOT 31,6,1,3,10,2:PRINT "X 10":PLOT 15,3,14,1:PRINT SI
2400 PLOT  14,6,3:FOR  I= 10 TO  55 STEP  7.5:PLOT  3,I,31:PRINT (I- 10)/ 1.5:NEXT  I
2410 PLOT  3,56,31:PRINT  "YEARS"
2412 PLOT 14,3,3,11,27,10:PRINT "VALUE \$":PLOT 27,24
2420 PLOT  15,6,2,2,20,MS(0),242:FOR  I= 1 TO  30:PLOT  20+ 3* I,MS(I):NEXT  I:PLOT  255
2450 GOTO  2480
2460 PLOT 6,2, 2,20,D(0),242:FOR  I= 1 TO  30:PLOT  20+ 3* I,D(I):NEXT  I:PLOT  255
2480 PLOT 6,1,2,20,SUM(0),242:FOR  I= 1 TO  30:PLOT  20+ 3* I,SUM(I):NEXT  I:PLOT  255
2500 PLOT 6,6, 2,20,PV(0),242:FOR  I= 1 TO  30:PLOT  20+ 3* I,PV(I):NEXT  I:PLOT  255
2600 PLOT 15,3,16,6:PRINT "AMOUNT INVESTED:\$";Z2
2650 PLOT 3,16,8:PRINT "ANNUITY VALUE:\$";Z1
2660 PLOT 3,16,10:PRINT "ANNUITY VALUE IN"
2670 PLOT 3,16,11:PRINT "TODAY'S DOLLARS:\$";Z4
2680
2690 PLOT 3,18,1:PRINT "AT";100* IR;"% INFLATION, IT WILL TAKE \$";Z3
2700 PLOT 3,20,2:PRINT "TO BUY WHAT YOU CAN BUY FOR \$1 TODAY."
2705
2710
3000 PLOT  27,11
```