10 CLS
20 KEY OFF
30 PRINT "FUTURE VALUE OF AN INVESTMENT"
40 DEFDBL A-Z:DEFINT N,J
50 DEF FNA(X)=INT(X*100+.5)/100
60 PRINT
70 PRINT "  NUMBER OF CASH FLOWS ";
80 INPUT N
90 PRINT "       GROWTH RATE (%) ";
100 INPUT R
110 R=R/100
120 PRINT
130 T=0
140 PRINT "(ENTER INFLOWS AS POSITIVE,";
150 PRINT " OUTFLOWS AS NEGATIVE)"
160 FOR J = 1 TO N
170 IF J>1 THEN 200
180 PRINT "AMOUNT OF CASH FLOW ";
190 GOTO 210
200 PRINT "                    ";
210 PRINT J;
220 INPUT C
230 REM  ADD FUTURE VALUES OF EACH YEAR BASED ON RATE OF R
240 T=T+FNA(C*(1+R)^(N-J))
250 NEXT J
260 PRINT
270 PRINT "FUTURE VALUE AT END OF PERIOD";N;"=";
280 PRINT USING "$$,###,###,###.##"; T
290 REM  RESTART OF END PROGRAM?
300 PRINT
310 PRINT "DO YOU WANT TO RE-RUN THIS PROGRAM";
320 PRINT " WITH NEW DATA (Y/N)?"
330 Z$=INKEY$:IF Z$="" THEN 330
340 IF Z$="Y" OR Z$="y" THEN 60
350 IF Z$<>"N" AND Z$<>"n" THEN 310
360 END