1 REM ANNUDEF
5 CLEAR 1000
10 CLS:PRINT TAB(10); "PRESENT VALUE OF A DEFERRED ANNUITY":PRINT
20 PRINT"AN ANNUITY IS A SEQUENCE OF EQUAL PAYMENTS MADE AT EQUAL
25 PRINT"INTERVALS OF TIME. A DEFERRED ANNUITY IS AN ANNUITY FOR
30 PRINT"WHICH THE FIRST PAYMENT IS NOT MADE UNTIL SOME FIXED TIME
35 PRINT"IN THE FUTURE. THIS PROGRAM WILL COMPUTE THE PRESENT VALUE
40 PRINT"OF A DEFERRED ANNUITY GIVEN THE AMOUNT OF THE INDIVIDUAL
45 PRINT"PAYMENTS, THE NUMBER OF PAYMENTS, THE INTEREST RATE, AND
50 PRINT"THE TIME THE ANNUITY BEGINS. IF DESIRED, A LAST EXTRA 
55 PRINT"BALLOON PAYMENT COINCIDING WITH BUT IN ADDITION TO THE
60 PRINT"LAST PAYMENT MAY BE CONSIDERED.
90 PRINT:INPUT"PRESS ENTER TO BEGIN";Z9$
100 CLS
1155 PRINT:INPUT"IS INTEREST RATE QUOTED PER PERIOD(P) OR ANNUALLY(A)";ZI$
1157 IF ZI$<>"P" AND ZI$<>"A" THEN PRINT"INPUT ERROR":GOTO 1155
1158 IF ZI$="A" THEN PRINT:INPUT"NUMBER OF PAYMENTS PER YEAR";ZN
1160 IF ZI$="A" THEN INPUT"NUMBER OF YEARS INTO FUTURE UNTIL 1ST PAYMENT";NF
1400 GOSUB 3000:GOSUB 3080
1405 I=I/100
1410 PV=PMT*(1/I)*(1-(1+I)[(-N))+BAL*(1+I)[(-N)
1420 PV=PV*(1+I)[(-NF)
1460 GOTO 5000
3000 REM INPUT SBR
3010 CLS:PRINT"ENTER EACH OF THE FOLLOWING.
3050 IF ZI$="A" THEN INPUT"ANNUAL INTEREST RATE(%) ";I
3056 IF ZI$="A" THEN I=I/ZN:NF=NF*ZN-1: GOTO 3070
3060 INPUT"INTEREST RATE PER PERIOD(%)";I
3065 INPUT"# OF PERIODS INTO FUTURE UNTIL FIRST PAYMENT";NF
3067 NF=NF-1
3070 INPUT"TOTAL NUMBER OF PAYMENTS";N
3075 RETURN
3080 INPUT"ENTER REGULAR PAYMENT";PMT
3085 INPUT"BALLOON PAYMENT            ";BAL
3090 RETURN
5000 REM PRINT OUT
5010 CLS
5025 PRINT"PRESENT VALUE       =";PV
5030 PRINT"NUMBER OF PAYMENTS  =";N
5033 IF ZI$="A" THEN PRINT "     CONSISTING OF ";ZN;" PAYMENTS ANNUALLY."
5035 IF ZI$="A" THEN PRINT"ANNUAL INTEREST RATE  =";100*I*ZN:GOTO 5050
5040 PRINT"INT. RATE PER PERIOD=";100*I
5045 PRINT"PAYMENTS BEGIN";NF+1;"PERIODS INTO THE FUTURE."
5047 IF NI$="A" THEN PRINT"THIS IS";(NF+1)/NV;"YEARS IN THE FUTURE."
5050 PRINT"PAYMENT             =";PMT
5060 IF BAL<>0 THEN  PRINT"BALLOON PAYMENT     =";BAL
5090 PRINT:INPUT"PRESS ENTER FOR MORE";Z9
5095 IF Z9 = 0 THEN END
5100 GOTO 100
