1 REM SINKFUND  
5 CLEAR  1000  
9 CLS  
10 PRINT  TAB(15); "SINKING FUNDS":PRINT   
20 PRINT "A SINKING FUND IS AN ANNUITY WHICH MUST ACCUMULATE TO SOME  
25 PRINT "FIXED AMOUNT BY A GIVEN TIME IN THE FUTURE. THIS MEANS THAT  
30 PRINT "A FIXED AMOUNT WILL BE PAID INTO A FUND EVERY PERIOD AND  
35 PRINT "EARN INTEREST. AT THE END OF THE LAST PERIOD THE SUM OF  
40 PRINT "THE PAYMENTS AND THE INTEREST WILL JUST EQUAL THE PREDE-FIXED  
45 PRINT "AMOUNT. IN THIS PROGRAM WE MUST INPUT THE FUTURE DESIRED  
50 PRINT "AMOUNT(FUTURE VALUE), THE INTEREST RATE AND THE NUMBER  
55 PRINT "PAYMENTS NEEDED. THE PROGRAM WILL COMPUTE THE PAYMENT AND  
60 PRINT "WILL PRINT UP A TABLE SHOWING HOW THE FUND GROWS."  
90 PRINT :INPUT "PRESS ENTER TO BEGIN";Z9$  
250 CLS  
255 CLEAR  1000  
260 PRINT :INPUT "IS INTEREST RATE QUOTED PER PERIOD(P) OR ANNUALLY(A)";ZI$  
270 IF  ZI$<>"P"  AND  ZI$<>"A" THEN PRINT "INPUT ERROR":GOTO  260  
280 IF  ZI$="A" THEN PRINT :INPUT "NUMBER OF PAYMENTS PER YEAR";ZN  
290 REM"ORDINARY ANNUITY-FUTURE VALUE TYPE PROBLEM  
300 CLS  
310 GOSUB  350  
320 I=I/100  
330 PMT=FV*I/((1+I)[N-1)  
340 GOTO 420:REM PRINTOUT  
350 REM INPUT SBR  
360 CLS:PRINT "ENTER EACH OF THE FOLLOWING.":PRINT   
370 INPUT "FUTURE VALUE               ";FV  
380 INPUT "NUMBER OF PAYMENTS         ";N  
390 IF  ZI$="A" THEN INPUT "ANNUAL INTEREST RATE(%)    ";I:I=I/ZN:GOTO  410  
400 INPUT "INTEREST RATE PER PERIOD(%)";I  
410 RETURN   
420 REM PRINT OUT  
430 CLS  
440 PRINT "SINKING FUND FOR";N;"PAYMENTS AT INTEREST RATE OF";100*I;"% PER PERIOD"  
450 PRINT "NUMBER OF PAYMENTS  =";N  
460 IF  ZI$="A" THEN PRINT  "     CONSISTING OF ";ZN;" PAYMENTS ANNUALLY."  
470 IF  ZI$="A" THEN PRINT "ANNUAL INTEREST RATE  =";100*I*ZN:GOTO  490  
480 PRINT "INT. RATE PER PERIOD=";100*I  
490 PRINT "PAYMENT             =";PMT  
500 PRINT :INPUT "PRESS ENTER FOR TO PRINT TABLE";Z9  
510 CLS  
520 PP(1)=0:QQ(1)=0:D1F(1)=0:REM SUM OF PAYMENTS,INT,&INCR. IN FUND  
530 F$(1)="END PERIOD  DEPOSIT   INT ON FUND   INCR. IN FUND  AMT IN FUND"  
540 F$(2)="  ###     #######.##    ######.##     #######.##    #######.##"  
550 F$(3)=" TOTALS   #######.##    ######.##     #######.##    #######.##"  
560 PRINT  F$(1):PRINT   
565 A=0  
570 FOR  J= 1  TO  N  
580 TT=A*I:A=A+TT+PMT:D1F=TT+PMT  
590 REM A=AMT IN FUND:TT=INTEREST ON FUND:DIF=INCR IN FUND  
600 PRINT USING  F$(2);J,PMT,TT,D1F,A  
610 IF  J/12=INT(J/12)  THEN  GOSUB  670:CLS:PRINT  F$(1):PRINT   
620 PP(1)=PP(1)+PMT:QQ(1)=QQ(1)+TT:D1F(1)=D1F(1)+D1F  
630 NEXT  J  
640 PRINT USING  F$(3);PP(1),QQ(1),D1F(1)  
650 PRINT :INPUT "IS LINE PRINTER OUTPUT DESIRED(Y/N)";Z2$  
652 IF  Z2$="Y"  THEN  GOTO  700  
655 IF  Z2$="N"  THEN  GOTO  250  
657 PRINT "INPUT ERROR":PRINT :GOTO  650  
660 GOTO  250  
670 INPUT "PRESS ENTER TO CONTINUE";Z9$:RETURN   
700 REM PRINT OUT  
710 CLS  
720 LPRINT "SINKING FUND FOR";N;"PAYMENTS AT INTEREST RATE OF";100*I;"% PER PERIOD"  
730 LPRINT "NUMBER OF PAYMENTS  =";N  
740 IF  ZI$="A"  THEN  LPRINT  "     CONSISTING OF ";ZN;" PAYMENTS ANNUALLY."  
750 IF  ZI$="A"  THEN  LPRINT "ANNUAL INTEREST RATE  =";100*I*ZN:GOTO  770  
760 LPRINT "INT. RATE PER PERIOD=";100*I  
770 LPRINT "PAYMENT             =";PMT  
780 LPRINT " ":LPRINT " ":LPRINT " "  
800 PP(1)=0:QQ(1)=0:D1F(1)=0:REM SUM OF PAYMENTS,INT,&INCR. IN FUND  
810 F$(1)="END PERIOD  DEPOSIT   INT ON FUND   INCR. IN FUND  AMT IN FUND"  
820 F$(2)="  ###     #######.##    ######.##     #######.##    #######.##"  
830 F$(3)=" TOTALS   #######.##    ######.##     #######.##    #######.##"  
840 LPRINT  F$(1):LPRINT " "  
845 A=0  
850 FOR  J= 1  TO  N  
860 TT=A*I:A=A+TT+PMT:D1F=TT+PMT  
870 REM A=AMT IN FUND:TT=INTEREST ON FUND:DIF=INCR IN FUND  
880 LPRINT  USING  F$(2);J,PMT,TT,D1F,A  
900 PP(1)=PP(1)+PMT:QQ(1)=QQ(1)+TT:D1F(1)=D1F(1)+D1F  
910 NEXT  J  
920 LPRINT  USING  F$(3);PP(1),QQ(1),D1F(1)  
925 INPUT "PRESS ENTER FOR MORE";Z9$
927 IF Z9$ = "-1" THEN END
928 GOTO  250  
930 INPUT "PRESS ENTER TO CONTINUE";Z9$:RETURN   

