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.
 
 
 
 
 
 

78 lines
2.5 KiB

  1. 5 CLS
  2. 10 PRINT " MORTGAGE AMORTIZATION"
  3. 20 PRINT
  4. 30 PRINT "THIS PROGRAM WILL PRINT A TABLE DESCRIBING MORTGAGE REPAYMENT.
  5. 40 PRINT "INPUT IS THE MORTGAGE PRINCIPAL,MONTHLY PAYMENT,TERM IN YEARS,
  6. 50 PRINT "AND ANNUAL INTEREST RATE.
  7. 60 PRINT "OUTPUT INCLUDES,FOR EACH PAYMENT, AMOUNT AMORTIZED,AMOUNT OF
  8. 70 PRINT "INTEREST, AND BALANCE LEFT ON MORTGAGE.
  9. 90 PRINT
  10. 91 INPUT "IS DELAY AFTER EACH YEAR DESIRED(Y/N)";Z3$
  11. 92 IF Z3$<>"Y" AND Z3$<>"N" THEN GOTO 91
  12. 93 INPUT "IS LINE PRINTER OUTPUT DESIRED(Y/N)";Z2$
  13. 94 IF Z2$<>"Y" AND Z2$<>"N" THEN GOTO 93
  14. 95 INPUT "PRESS ENTER TO BEGIN";Z9
  15. 100 CLS
  16. 102 GOTO 110
  17. 104 REM DELETE LINE 102 FOR DOUBLE PRECISION BUT SLOW RESULTS
  18. 105 DEFDBL A-I,L-X
  19. 110 INPUT "MORTGAGE PRINCIPAL = ";P
  20. 115 B=P
  21. 120 INPUT "MONTHLY PAYMENT = ";M
  22. 130 INPUT "TERM OF MORTGAGE = ";Y
  23. 140 INPUT "ANNUAL INT. RATE(%)= ";I
  24. 150 MI=I/1200 :REM MONTHLY INTEREST RATE
  25. 200 NF = 12*Y
  26. 205 YR=0:ATX=0:IT=0
  27. 210 IF NF>12 THEN GOTO 300 ' SEE IF MORE THAN 1 YR LEFT
  28. 220 AY=0:IY=0
  29. 230 GOSUB 1000
  30. 235 FOR K=1 TO NF-1
  31. 240 GOSUB 1200
  32. 250 NEXT K
  33. 260 NF=0
  34. 270 GOSUB 1200
  35. 275 F$(1)="FINAL PAYMENT = $$#####.##"
  36. 280 PRINT USING F$(1);A+IPX
  37. 285 IF Z2$="Y" THEN LPRINT USING F$(1);A+IPX
  38. 295 END
  39. 300 REM FIND RESULTS FOR 1 YEAR
  40. 305 GOSUB 1000
  41. 307 AY=0:IY=0
  42. 310 FOR K= 1 TO 12
  43. 320 GOSUB 1200
  44. 330 NEXT K
  45. 340 NF=NF-12
  46. 345 YR=YR+1
  47. 350 GOSUB 1300
  48. 355 IF Z3$="N" THEN GOTO 210
  49. 360 INPUT "PRESS ENTER FOR ANOTHER YEAR";Z9
  50. 370 GOTO 210
  51. 1000 REM PAGE HEADING SUBROUTINE
  52. 1001 V$="%"
  53. 1005 A1$="PRIN.=$$#####.## PAYMENT=$$###.## TERM= ##.## YRS RATE=##.# !
  54. 1007 A2$=" NO. INTEREST AMORTIZED BALANCE "
  55. 1010 CLS
  56. 1020 PRINT USING A1$;P,M,Y,I,V$;:IF Z2$="Y" THEN LPRINT USING A1$;P,M,Y,I,V$
  57. 1030 PRINT A2$:IF Z2$="Y" THEN LPRINT A2$:LPRINT " "
  58. 1050 RETURN
  59. 1100 REM PRINTING SUBROUTINE FOR MONTHLY PAYMENT
  60. 1105 A3$=" ## ###.## ####.## ######.##
  61. 1110 PRINT USING A3$;NY,IPX,A,B
  62. 1115 IF Z2$="Y" THEN LPRINT USING A3$;NY,IPX,A,B
  63. 1120 RETURN
  64. 1200 REM COMPUTATION SUBROUTINE
  65. 1218 NY=K
  66. 1220 IPX=B*MI:A=M-IPX:B=B-A:ATX=ATX+A:IT=IT+IPX:IY=IY+IPX
  67. 1225 AY=AY+A
  68. 1226 IF NF=0 THEN A=P-ATX-R
  69. 1227 IF NF=0 THEN B=0
  70. 1230 GOSUB 1100
  71. 1240 RETURN
  72. 1300 REM END OF YEAR SUBROUTINE
  73. 1310 A4$="YR.=## ####.## ####.##"
  74. 1320 PRINT USING A4$;YR,IY,AY
  75. 1325 IF Z2$="Y" THEN LPRINT USING A4$;YR,IY,AY:LPRINT " ":LPRINT " "
  76. 1330 RETURN