
100 'THIS TRIVIAL ROUTINE CALCULATE THE PRESENT VALUE
110 'OF A NON-CASH SECURITY WHICH AMORTIZES AND/OR PAYS INTEREST
120 'OR DIVIDENDS.
130 'USEFUL IN EVALUATING THE TREATMENT OF A CLAIM BY CHAPTER X
140 'PLAN OF RE-ORG. OR XI ARRANGEMENT (OR SECT 77 RAILROAD REORG.)
1000 REM PV OF CASH FLOW STREAM OF RE-PAYMENTS
2000 DIM B(50),C(50),P(50)
3000 INPUT"STARTING PRINCIPAL";A1
4000 INPUT"DISCOUNT RATE, IN %";A2
5000 FOR N=1 TO 999
6000 INPUT"PAYMENTS AND TIME FROM START IN YEARS";B(N),C(N)
7000 N1=N1+1
8000 A1=A1-B(N)
9000 GOSUB 13000
10000 PRINT A1,P(N),P2
11000 IF A1<1E-08 THEN 16000
12000 NEXT N
13000 P(N)=B(N)/(1+A2/100)^C(N)
14000 P2=P2+P
15000 RETURN
16000 PRINT:PRINT
17000 PRINT"PAYMENT #","AMOUNT","AFTER YRS.","PRES. VAL."
18000 FOR N=1 TO N1
19000 PRINT N,B(N),C(N),P(N)
20000 B1=B1+B(N):C1=C1+C(N):P1=P1+P(N)
21000 NEXT N
22000 PRINT"---------","----------","-------","----------"
23000 PRINT"TOTAL",B1,"N/A",P1
=C1+C(N):P1=P1+P(N)
21000 NEXT N
22000 PRINT"---------","----