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.
 
 
 
 
 
 

192 lines
5.3 KiB

  1. 10 L1=9
  2. 20 DEF FNR(X)=INT(X*100+.5)/100
  3. 30 CL$=CHR$(26):REM SCREEN CLEAR CHAR.
  4. 40 REM ********************************************************
  5. 50 REM
  6. 60 PRINT CL$;"THIS PROGRAM IS A COLLECTION OF BUSINESS"
  7. 70 PRINT "APPLICATIONS. HERE IS A LIST OF THE VALUES THAT"
  8. 80 PRINT "CAN BE COMPUTED GIVEN SUPPORTING DATA:"
  9. 90 PRINT
  10. 100 PRINT "1) FUTURE VALUE OF AN INVESTMENT"
  11. 110 PRINT "2) FUTURE VALUE OF REGULAR DEPOSITS (ANNUITY)"
  12. 120 PRINT "3) REGULAR DEPOSITS"
  13. 130 PRINT "4) REGULAR DEPOSITS FROM AN INVESTMENT"
  14. 140 PRINT "5) INITIAL INVESTMENT"
  15. 150 PRINT "6) MINIMUM INVESTMENT FOR WITHDRAWALS"
  16. 160 PRINT "7) NOMINAL INTEREST RATE ON INVESTMENTS"
  17. 170 PRINT "8) EFFECTIVE INTEREST RATE ON INVESTMENTS"
  18. 180 PRINT "9) EARNED INTEREST TABLE"
  19. 190 PRINT
  20. 200 PRINT "WHICH OF THE ABOVE VALUES WOULD YOU LIKE"
  21. 210 PRINT "TO COMPUTE ( 1 TO";L1;", OR 0 TO END RUN )";
  22. 220 INPUT X
  23. 230 PRINT CL$
  24. 240 IF X=0 THEN 1860
  25. 250 ON X GOSUB 270,360,470,590,690,800,910,1010,1150
  26. 260 GOTO 90
  27. 270 PRINT "FUTURE VALUE OF AN INVESTMENT"
  28. 280 PRINT:INPUT "INITIAL INVESTMENT (0 TO STOP) ";P:IF P=0 THEN RETURN
  29. 290 GOSUB 1130
  30. 300 GOSUB 1140
  31. 310 GOSUB 1110
  32. 320 I=I/N/100
  33. 330 T=P*(I+1)^(N*Y)
  34. 340 GOSUB 1100
  35. 350 GOTO 280
  36. 360 PRINT "FUTURE VALUE OF REGULAR DEPOSITS (ANNUITY)"
  37. 370 PRINT
  38. 380 INPUT "AMOUNT OF REGULAR DEPOSITS (0 TO STOP)";R
  39. 390 IF R=0 THEN RETURN
  40. 400 GOSUB 1130
  41. 410 INPUT "NUMBER OF DEPOSITS PER YEAR";N
  42. 420 GOSUB 1110
  43. 430 I=I/N/100
  44. 440 T=R*((I+1)^(N*Y)-1)/I
  45. 450 GOSUB 1100
  46. 460 GOTO 370
  47. 470 PRINT "REGULAR DEPOSITS"
  48. 480 PRINT
  49. 490 INPUT "TOTAL VALUE AFTER Y YEARS (0 TO STOP) ";T
  50. 500 IF T=0 THEN RETURN
  51. 510 GOSUB 1130
  52. 520 DEF FNR(X)=INT(X*100+.5)/100
  53. 530 INPUT "NUMBER OF DEPOSITS PER YEAR";N
  54. 540 GOSUB 1110
  55. 550 I=I/N/100
  56. 560 R=T*I/((I+1)^(N+Y)-1)
  57. 570 PRINT "REGULAR DEPOSITS: $";INT(R*100+.5)/100
  58. 580 GOTO 480
  59. 590 PRINT "REGULAR WITHDRAWALS FROM AN INVESTMENT"
  60. 600 PRINT:INPUT"INITIAL INVESTMENT (0 TO STOP) ";P
  61. 610 IF P=0 THEN RETURN
  62. 620 GOSUB 1130
  63. 630 INPUT "NUMBER OF WITHDRAWALS PER YEAR";N
  64. 640 GOSUB 1110
  65. 650 I=I/N/100
  66. 660 R=P*(I/((I+1)^(N*Y)-1)+I)
  67. 670 PRINT "AMOUNT OF EACH WITHDRAWAL = $";INT(R*100+.5)/100
  68. 680 GOTO 600
  69. 690 PRINT "INITIAL INVESTMENT"
  70. 700 PRINT
  71. 710 INPUT "TOTAL VALUE AFTER Y YEARS (0 TO STOP) ";T
  72. 720 IF T=0 THEN RETURN
  73. 730 GOSUB 1140
  74. 740 GOSUB 1110
  75. 750 GOSUB 1130
  76. 760 I=I/N/100
  77. 770 P=T/(I+1)^(N*Y)
  78. 780 PRINT "INITIAL INVESTMENT = $";INT(P*100+.5)/100
  79. 790 GOTO 700
  80. 800 PRINT "MINIMUM INVESTMENT FOR WITHDRAWALS"
  81. 810 PRINT
  82. 820 INPUT "AMOUNT OF WITHDRAWALS (0 TO STOP) ";R
  83. 830 IF R=0 THEN RETURN
  84. 840 GOSUB 1130
  85. 850 INPUT "NUMBER OF WITHDRAWALS PER YEAR";N
  86. 860 GOSUB 1110
  87. 870 I=I/100
  88. 880 P=R*N/I*(1-1/((1+I/N)^(N*Y)))
  89. 890 PRINT "MINIMUM INVESTMENT = $";INT(100*P+.5)/100
  90. 900 GOTO 810
  91. 910 PRINT "NOMINAL INTEREST RATE ON INVESTMENTS"
  92. 920 PRINT
  93. 930 INPUT "PRINCIPAL (0 TO STOP)";P
  94. 940 IF P=0 THEN RETURN
  95. 950 INPUT "TOTAL VALUE";T
  96. 960 GOSUB 1110
  97. 970 GOSUB 1140
  98. 980 I2=N*((T/P)^(1/(N*Y))-1)*100
  99. 990 PRINT "NOMINAL INTEREST RATE = ";I2;"%"
  100. 1000 GOTO 920
  101. 1010 PRINT "EFFECTIVE INTEREST RATE ON INVESTMENTS"
  102. 1020 PRINT
  103. 1030 INPUT "INITIAL INVESTMENT (0 TO STOP) ";P
  104. 1040 IF P=0 THEN RETURN
  105. 1050 INPUT "TOTAL VALUE AFTER Y YEARS";T
  106. 1060 GOSUB 1110
  107. 1070 PRINT "ANNUAL INTEREST RATE = ";((T/P)^(1/Y)-1)*100;"%"
  108. 1080 GOTO 1020
  109. 1090 REM *******
  110. 1100 PRINT "FUTURE VALUE = $"; INT(T*100+.5)/100:RETURN
  111. 1110 INPUT "NUMBER OF YEARS AND MONTHS (2 NUMBERS WITH A COMMA BETWEEN THEM)";Y0,M
  112. 1120 Y=(12*Y0+M)/12:RETURN
  113. 1130 INPUT "NOMINAL INTEREST RATE (0 TO 100) ";I:RETURN
  114. 1140 INPUT "NUMBER OF COMPOUNDING PERIODS PER YEAR";N:RETURN
  115. 1150 PRINT "**** EARNED INTEREST TABLE GENERATOR ***"
  116. 1160 PRINT
  117. 1170 INPUT "PRINCIPAL";P
  118. 1180 GOSUB 1130
  119. 1190 I=I/100
  120. 1200 INPUT "NUMBER OF DEPOSITS/WITHDRAWALS PER YEAR";N1
  121. 1210 IF N1=0 THEN 1260
  122. 1220 INPUT "AMOUNT OF DEPOSIT/WITHDRAWAL";R
  123. 1230 N=360
  124. 1240 L2=N1
  125. 1250 GOTO 1290
  126. 1260 GOSUB 1140
  127. 1270 N1=0
  128. 1280 L2=4
  129. 1290 INPUT "START WITH WHAT YEAR (WHERE 1 MEANS THE FIRST, 2 THE SECOND, ETC.) ";X
  130. 1300 INPUT "END WITH WHAT YEAR";Y
  131. 1310 X=INT(X)
  132. 1320 B0=P:I1=0:I2=0:I3=0:K=66:P1=4
  133. 1330 FOR J0=1 TO INT(Y)+1
  134. 1340 IF J0<X THEN 1510
  135. 1350 IF K<55 THEN 1500
  136. 1360 REM SPACE TO NEXT PAGE, PRINT HEADINGS (ASSUMING 66 LINES/PAGE)
  137. 1370 FOR K1=K TO 66
  138. 1380 PRINT
  139. 1390 NEXT K1
  140. 1400 K=6
  141. 1410 PRINT " EARNED INTEREST TABLE"
  142. 1420 PRINT " PRINCIPAL= $";P;" AT ";I*100;"% NOMINAL FOR ";Y;"YEARS"
  143. 1430 IF N1=0 THEN 1460
  144. 1440 PRINT "REGULAR DEPOSIT/WITHDRAWAL $";R;". ";N1;" TIMES PER YEAR"
  145. 1450 K=K+1
  146. 1460 PRINT " EFFECTIVE INTEREST RATE";FNR(100*((1+I/N)^N-1));"% PER YEAR"
  147. 1470 PRINT
  148. 1480 PRINT "YEAR","BALANCE","INTEREST","ACCUM. INTEREST"
  149. 1490 PRINT
  150. 1500 PRINT J0,
  151. 1510 L1=1
  152. 1520 N2=1
  153. 1530 P2=1
  154. 1540 FOR J1=1 TO N
  155. 1550 IF N2>N1 THEN 1590
  156. 1560 IF N2/N1>J1/N THEN 1590
  157. 1570 B0=B0+R
  158. 1580 N2=N2+1
  159. 1590 B2=B0*(1+I/N)
  160. 1600 I1=B2-B0
  161. 1610 I3=I3+I1
  162. 1620 I2=I2+I1
  163. 1630 IF P2/P1>J1/N THEN 1670
  164. 1640 I2=FNR(I2)
  165. 1650 B2=FNR(B2)
  166. 1660 P2=P2+1
  167. 1670 IF J0<X THEN 1750
  168. 1680 IF J1/N<L1/L2 THEN 1750
  169. 1690 L1=L1+1
  170. 1700 PRINT TAB(17);
  171. 1710 PRINT FNR(B2),FNR(I3),FNR(I2)
  172. 1720 I3=0
  173. 1730 K=K+1
  174. 1740 REM
  175. 1750 B0=B2
  176. 1760 IF J0+J1/N-1>=Y THEN 1820
  177. 1770 NEXT J1
  178. 1780 IF J0<X THEN 1810
  179. 1790 PRINT
  180. 1800 K=K+1
  181. 1810 NEXT J0
  182. 1820 PRINT
  183. 1830 PRINT "CHANGE DATA AND RECOMPUTE ";
  184. 1840 INPUT A$:IF LEFT$(A$,1)="Y" THEN 1160
  185. 1850 RETURN
  186. 1860 REM RUN "DIR"
  187. 1870 END
  188. 2000 REM -------------------------------
  189. 2010 REM commented out line 1860
  190. 2020 REM added space after IF stmts
  191. 2999 END