ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

41 lines
1.7 KiB

  1. 1 REM BONDVAL2
  2. 5 CLEAR 1000
  3. 10 CLS:PRINT TAB(10);"VALUE OF A BOND":PRINT
  4. 20 PRINT"THIS PROGRAM SHOWS HOW THE VALUE OF A BOND MAY CHANGE
  5. 25 PRINT"WHEN THE INTEREST RATE CHANGES. WE ASSUME WE HAVE A BOND WITH
  6. 30 PRINT"A FIXED NUMBER OF YEARS TO MATURITY. FOR VARIOUS INTEREST
  7. 35 PRINT"RATES THE PRESENT VALUE OF THE FUTURE CASHFLOWS FROM THE
  8. 40 PRINT"BOND ARE DETERMINED. IT IS VERY INTERESTING TO SEE HOW MUCH
  9. 45 PRINT"THIS VARIES FOR LONG TERM BONDS.
  10. 90 PRINT:INPUT"PRESS ENTER TO BEGIN";Z9$
  11. 95 DIM A(15),I(15)
  12. 100 CLS
  13. 110 INPUT "NUMBER OF YEARS TO MATURITY ";N
  14. 120 INPUT "COUPON INTEREST PAYMENT PER YEAR ";C
  15. 130 INPUT "MATURITY VALUE OF THE BOND ";M
  16. 140 INPUT"LOWEST INTEREST RATE TO CONSIDER(%) ";L:L=L/100
  17. 150 INPUT"HIGHEST INTEREST RATE TO CONSIDER(%)";H:H=H/100
  18. 195 REM COMPUTING PV
  19. 197 K=0
  20. 200 FOR I=L TO H STEP (H-L)/10
  21. 205 K=K+1
  22. 210 I(K)=I:A(K)=C*(1-(1+I)[(-N))/I + M*(1+I)[(-N)
  23. 220 NEXT I
  24. 225 INPUT"DO YOU DESIRE LINE PRINTER OUTPUT(Y/N)";Z2$
  25. 230 CLS:PRINT"PRESENT VALUE OF BOND AT VARYING INTEREST RATES":PRINT
  26. 240 PRINT N;"YEARS TO MATURITY."
  27. 250 PRINT"COUPON PAYS $";C;" PER YEAR FOR INTEREST.
  28. 260 PRINT"MATURITY VALUE FOR THE BOND IS";M
  29. 262 IF Z2$="N" THEN GOTO 270
  30. 265 LPRINT N;"YEARS TO MATURITY."
  31. 266 LPRINT"COUPON PAYS $";C;" PER YEAR FOR INTEREST.
  32. 267 LPRINT"MATURITY VALUE FOR THE BOND IS";M
  33. 270 F$(1)= "INTEREST RATE VALUE OF BOND"
  34. 280 F$(2)= " ###.# ######.##
  35. 290 PRINT F$(1):IF Z2$="Y" THEN LPRINT F$(1):LPRINT" "
  36. 300 FOR K=1 TO 10:PRINT USING F$(2);100*I(K),A(K):NEXT
  37. 310 IF Z2$="Y" THEN FOR K=1 TO 10:LPRINT USING F$(2);100*I(K),A(K):NEXT
  38. 320 PRINT:INPUT"PRESS ENTER FOR MORE COMPUTATION";Z9$
  39. 325 IF Z9$ = "-1" THEN END
  40. 330 GOTO 100