--- title: "Investment/Loan" id: 54973 type: "computer_media" slug: "invest-loan" url: "http://localhost/computer_media/invest-loan/" markdown_url: "http://localhost/computer_media/invest-loan.md" published_at: "2024-06-10T01:44:45+00:00" modified_at: "2026-03-30T21:43:19+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2019/02/20230809-041332.jpg" excerpt: "A full-featured financial calculator solving investments, loans, and cash flows — enter \"X\" for any unknown and let the program find it automatically." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Algis Gedris" slug: "algis-gedris" taxonomy: "indiv" url: "http://localhost/indiv/algis-gedris/" genre: - name: "Finance" slug: "finance" taxonomy: "genre" url: "http://localhost/type/finance/" media_contents: - id: 54964 title: "ISTUG Public Domain Library 6" type: "computer_media" url: "http://localhost/computer_media/istug-public-domain-library-6/" media_type: "Program" programmers: - name: "Algis Gedris" slug: "algis-gedris" taxonomy: "indiv" url: "http://localhost/indiv/algis-gedris/" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2024/06/SCR-20260329-nptj.png" - url: "http://localhost/wp-content/uploads/2024/06/SCR-20260329-npnv.png" media_type_tags: "Finance" --- This program is a comprehensive investment and loan calculator offering twelve distinct financial computations, including future value with periodic or continuous compounding, regular deposits, cash flow analysis, net present value, loan amortization schedules, and single-payment loan totals. The user selects an unknown variable by entering “X” at the appropriate prompt, and the program solves for it using either closed-form formulas or an iterative bisection algorithm for interest-rate calculations. Financial values are stored in an 8-element array V(), with V(PI) used as a compact reference to V(3) for the interest rate, exploiting the fact that INT(PI)=3. Lines 9994–9998 contain a printer font-selection routine that uses POKEs to system variables and RANDOMIZE USR to switch between Regular, Modern, Bold, and Italic typefaces for hardcopy output via the COPY command. *** ## Program Analysis ### Program Structure The program is divided into two top-level branches — Investments (lines 270–1940) and Loans (lines 2170–3940) — selected at lines 230–260. Each branch presents a numbered menu, and the user’s choice dispatches via a chain of `IF A=n THEN GO TO` statements. After any calculation completes, control returns to the relevant submenu via `GO TO 270` or `GO TO 2170` (reached through the shared path at line 710). ### Variable Storage and the V(PI) Idiom All financial parameters are stored in the numeric array `V(8)`, declared at line 100. The slots have consistent meanings throughout the program: | Index | Meaning | | --- | --- | | V(1) | Future value / present value (context-dependent) | | V(2) | Present value / principal | | V(3) = V(PI) | Interest rate (as decimal) | | V(4) | Years (integer part) or number of periods | | V(5) | Months (fractional year component) | | V(6) | Compounding periods per year | | V(7) | Regular deposit or payment amount | | V(8) | Regular withdrawal amount | A notable idiom throughout is the use of `V(PI)` as a shorthand for `V(3)`, since `INT(PI) = 3` in Sinclair BASIC. This saves a character per reference and appears dozens of times. Similarly, `PRINT AT PI,SX` targets row 3. ### Input Subroutine and Memory Register All variable entry is routed through the subroutine at line 3950. It increments the counter `C`, displays the current stored value of `V(C)` (converting `V(3)` to a percentage), then accepts a string input. Empty input leaves the variable unchanged (line 4020). Entering `"MR"` recalls a memory register `M` with a confirmation prompt (lines 4040–4090). Entering `"X"` marks that variable as the unknown by setting `E=C` (line 4100). Numeric input is stored in `V(C)`, divided by 100 if `C=3` to convert from percentage to decimal (lines 4130–4160). ### Solving for Unknowns When `E` is set to a variable index, the program branches to the appropriate closed-form solution. For quantities that have no algebraic closed form (specifically, solving for interest rate in compounding scenarios), the program uses a bisection/interval-halving algorithm. For example, lines 1150–1260 (deposits) and 1730–1840 (withdrawals) both: 1. Initialize `V(PI)=0.99` and a previous guess `I=0`. 2. Compute the target expression `T` or `R`. 3. Calculate step size `TE = ABS(V(PI)-I)/2`. 4. Adjust `V(PI)` up or down by `TE` depending on whether the result overshoots or undershoots. 5. Repeat until the result is within 0.005 of the target, then round to 4 decimal places. Note that the interest-rate solver for loans (lines 2560–2680) has its comparison logic inverted: when `P < V(2)` it subtracts `TE` (line 2650) and when `P > V(2)` it adds `TE` (line 2630). This is opposite to the investment solver but is consistent with the loan formula’s inverse relationship. ### Year/Month Decomposition The subroutine at lines 5180–5250 converts a decimal year count in `V(4)` into integer years and months. The fractional part is multiplied by 12 and rounded; if the result reaches 12, it carries over to the next year. This is used whenever the program solves for time (`E=4`), with the result displayed as “# YRS & MONTHS: Y ; M”. ### Loan Amortization Schedule (Lines 3230–3940) This is the most complex section. It accepts a starting month number and a year range, then iterates period by period. For each period it computes interest `I = INT(P * V(PI) / V(6) * 100 + 0.5) / 100`, tracks principal paid, and detects the final payment via the payment counter `N5` reaching `NP`. Output is paginated every 13 rows using the ENTER/COPY prompt subroutine at line 5330. A column-formatting subroutine at lines 5500–5507 right-aligns currency values in a 9-character field by left-padding with spaces and ensuring two decimal places. ### Printer Font Selection (Lines 9994–9998) Lines 9994–9998 implement a standalone printer font selector executed before the main program (via `SAVE ... LINE 9994`). It POKEs 80 bytes of machine code to a page-aligned address (`torg=255`, i.e., address 65280), then uses `RANDOMIZE USR` to switch between four typefaces: Regular, Modern, Bold, and Italic. System variables at addresses 23607, 23609, 23618, 23619, 23620, and 23658 are manipulated to configure the printer driver. The variable names `REG`, `BLD`, `MOD`, and `ITAL` are set to the line numbers of the corresponding POKE sequences (9990–9993), so the user’s choice `Z` is used directly as `GO SUB Z`. ### VAL String Expressions Several computationally intensive formulas use `VAL "..."` to evaluate string expressions. For example, line 600: `LET V(1)=VAL "INT (V(2)*(1+V(PI)/V(6))^(V(6)*Y)*100+.5)/100"`. This is a well-known Sinclair BASIC memory optimization: the expression inside `VAL` is not tokenized and stored as BASIC keywords, so it occupies less RAM than the equivalent direct assignment. ### Display Positioning with SX `SX` is initialized to 16 at line 150 and used throughout as the column argument to `PRINT AT row,SX`, placing numeric results consistently in the right half of the screen alongside left-aligned labels. This gives the display a two-column appearance without using `TAB`. ### Anomalies and Notable Details - Line 430 references `PRINT AT PI,SX;V(C)` and then calls `GO SUB 4750` — but `GO SUB 4750` itself calls `GO SUB 3950` which increments `C`, so the `V(C)` in the `PRINT AT` uses the pre-increment value. This is intentional: it re-displays the just-entered value. - Line 5460 is an empty `RETURN` with no corresponding `GO SUB` reachable in normal flow — it appears to be a vestigial stub. - The `DIM V(8)` at line 100 creates a 9-element array (indices 0–8), but index 0 is used as `V(C)` when `C=0` is set at line 4720 for the Future Value input — making use of the zero element intentional. - The string variables `V$`, `C$`, `G$`, and `Q$` set at lines 110–140 are never subsequently referenced in the listing, suggesting either removed functionality or leftover code from a development version. - Line 2310 checks `A>7` for the loan menu which only has 6 options, making choice 7 unreachable but harmlessly rejected. ## Source Code ``` 2 REM INVESTMENT/LOAN THIS PROGRAM IS PRESENTED BYALGIS E. GEDRIS355 ROYAL OAK BLVD.RICHMOND HEIGHTS, OHIO44143-1709(216)481-8205 100 DIM V(8) 110 LET V$="TPIYMNDW" 120 LET C$="VSHR" 130 LET G$="M+M-M*M/MRMC" 140 LET Q$="" 150 LET SX=16 190 LET M=0: LET NE=0: LET E=0: LET F1=0: LET L1=0 200 CLS 201 BORDER 2 210 PRINT ''''''''''';"INVESTMENT OR LOANS" 230 INPUT "INVESTMENT (I) / LOAN (L) : ";A$ 240 IF A$="I" THEN GO TO 270 250 IF A$="L" THEN GO TO 2170 260 GO TO 230 270 CLS 280 PRINT "INVESTMENTS:" 290 PRINT 300 PRINT "1) FUTURE VALUE WITH PERIODIC INTEREST." 310 PRINT "2) FUTURE VALUE WITH INTEREST COMPOUNDED CONTINUOUSLY." 320 PRINT "3) FUTURE VALUE WITH REGULAR DEPOSITS." 330 PRINT "4) FUTURE VALUE WITH CASH FLOWS." 340 PRINT "5) WITHDRAWAL OF FUNDS." 350 PRINT "6) NET PRESENT VALUE." 370 PRINT "7) RETURN TO MAIN MENU." 380 PRINT 390 PRINT "CHOICE:" 391 PRINT ''''"NOTE:"'"ENTER ""X"" FOR THE VARIABLE TO BESOLVED. APPLIES ONLY TO THE"'"VARIABLES PRECEDING WITH ""*""." 400 INPUT A$: LET a=VAL a$ 410 IF (A<1) OR (a>7) THEN GO TO 400 420 IF A=1 THEN GO TO 470 421 IF A=2 THEN GO TO 730 423 IF A=3 THEN GO TO 970 424 IF A=4 THEN GO TO 1360 425 IF A=5 THEN GO TO 1550 426 IF A=6 THEN GO TO 1940 427 GO TO 200 430 PRINT AT PI,SX;V(C),: GO SUB 4750 435 PRINT AT 4,SX;V(C),"*";: GO SUB 4840: PRINT AT 5,SX;V(C)*100,"*": GO TO 4880 440 PRINT AT PI,SX;V(C),"*";: GO SUB 4840: PRINT AT 4,SX;V(C)*100,"*";: GO SUB 4880: PRINT AT 5,SX;V(C),: RETURN 450 PRINT AT PI,SX;V(C),: GO SUB 4840: PRINT AT 4,SX;V(C)*100,: RETURN 460 GO SUB 5050: PRINT AT 6,SX;V(4),,V(5),: RETURN 470 CLS 480 PRINT "1) FUTURE VALUE WITH PERIODIC INTEREST" 490 PRINT 500 GO SUB 4710 501 GO SUB 430 551 PRINT AT 6,SX;V(4), 560 IF E=4 THEN GO TO 580 570 GO SUB 4920 572 PRINT AT 7,SX;V(5), 580 GO SUB 4970 581 IF E=4 THEN PRINT AT 7,SX;V(C),: GO TO 590 582 PRINT AT 8,SX;V(6), 590 IF E<>1 THEN GO TO 620 600 LET V(1)=VAL "INT (V(2)*(1+V(PI)/V(6))^(V(6)*Y)*100+.5)/100" 610 GO SUB 5090 620 IF E<>2 THEN GO TO 650 630 LET V(2)=VAL "INT (V(1)/((1+V(3)/V(6))^(V(6)*Y))*100+.5)/100" 640 GO SUB 5120 650 IF E<>3 THEN GO TO 680 660 LET V(PI)=VAL "INT ((V(6)*(V(1)/V(2))^(1/(V(6)*Y))-V(6))*10000+.5)/10000" 670 GO SUB 5150 680 IF E<>4 THEN GO TO 710 690 LET V(4)=.4342945*LN (V(1)/V(2))/(V(6)*.4342945*LN (1+V(PI)/V(6))) 700 GO SUB 5180 710 GO SUB 5330 720 GO TO 270 730 CLS 740 PRINT "2) FUTURE VALUE WITH INTEREST COMPOUNDED CONTINUOUSLY." 750 PRINT 760 GO SUB 4710 761 GO SUB 430 811 PRINT AT 6,SX;V(C), 820 IF E=4 THEN GO TO 840 830 GO SUB 4920 831 PRINT AT 7,SX;V(C), 840 IF E<>1 THEN GO TO 870 850 LET V(1)=INT (V(2)*EXP (V(PI)*Y)*100+.5)/100 860 GO SUB 5090 870 IF E<>2 THEN GO TO 900 880 LET V(2)=INT (V(1)/EXP (V(PI)*Y)*100+.5)/100 890 GO SUB 5120 900 IF E<>3 THEN GO TO 930 910 LET V(PI)=INT (.4342945*LN (V(1)/V(2))/Y*10000+.5)/10000 920 GO SUB 5150 930 IF E<>4 THEN GO TO 710 940 LET V(4)=VAL "INT (.4342945*LN (V(1)/V(2))/V(PI)*100+.5)/100" 950 GO SUB 5180 960 GO TO 710 970 CLS 980 PRINT "3) FUTURE VALUE WITH REGULAR DEPOSITS." 990 PRINT 1000 GO SUB 4710 1001 PRINT AT PI,SX;V(C), 1010 PRINT "*REG DEPOSITS $", 1020 LET C=6 1030 GO SUB 3950 1031 GO SUB 435 1071 PRINT AT 6,SX;V(C), 1080 IF E=4 THEN GO TO 1100 1090 GO SUB 4920 1091 PRINT AT 7,SX;V(C), 1100 GO SUB 4970 1101 IF E=4 THEN PRINT AT 7,SX;V(C),: GO TO 1104 1102 PRINT AT 8,SX;V(C), 1104 PRINT 1110 IF E<>1 THEN GO TO 1140 1120 LET V(1)=VAL "INT (V(7)*V(6)*((1+V(3)/V(6))^(V(6)*Y)-1)/V(3)*100+.5)/100" 1130 GO SUB 5090 1140 IF E<>3 THEN GO TO 1280 1150 LET V(PI)=.99 1160 LET I=0 1170 LET T=VAL "INT (V(7)*(((1+V(3)/V(6))^(V(6)*Y)-1)/(V(3)/V(6)))*100+.5)/100" 1180 LET TE=ABS (V(PI)-I)/2 1190 LET I=V(PI) 1200 IF ABS (T-V(1))<.005 THEN GO TO 1260 1210 IF T4 THEN GO TO 1310 1290 LET V(4)=.4342945*LN (V(PI)*V(1)/(V(6)*V(7))+1)/(V(6)*.4342945*LN (1+V(PI)/V(6))) 1300 GO SUB 5180 1310 IF E<>7 THEN GO TO 710 1320 LET V(7)=VAL "INT (V(1)*(V(3)/V(6))/((1+V(3)/V(6))^(V(6)*Y)-1)*100+.5)/100" 1330 PRINT 1340 PRINT "DEPOSITS REQD $",V(7) 1350 GO TO 710 1360 CLS 1370 PRINT "4) FUTURE VALUE WITH CASH FLOWS." 1380 PRINT 1390 GO SUB 4840 1391 PRINT AT 2,SX;V(C)*100, 1400 GO SUB 4880 1401 PRINT AT PI,SX;V(C), 1410 PRINT "CASH FLOW (+/-)" 1420 PRINT 1430 LET V(1)=0 1440 FOR I=1 TO V(4) 1450 PRINT "CASH FLOW-YEAR #";I 1460 INPUT A$ 1461 PRINT AT I+5,19;A$, 1470 LET A=VAL (A$) 1480 LET V(1)=V(1)+A*(1+V(PI))^(V(4)-I) 1490 NEXT I 1500 LET V(1)=INT (V(1)*100+.5)/100 1510 GO SUB 5090 1520 LET TE=V(1) 1530 GO SUB 5270 1540 GO TO 710 1550 CLS 1560 PRINT "5) WITHDRAWAL OF FUNDS " 1570 PRINT 1580 GO SUB 4750 1581 PRINT AT 2,SX;V(C), 1590 PRINT "*REG WITHDRW $", 1600 LET C=7 1610 GO SUB 3950 1611 GO SUB 440 1670 GO SUB 4920 1671 PRINT AT 6,SX;V(C), 1680 GO SUB 4970 1681 IF E=4 THEN PRINT AT 6,SX;V(C),: GO TO 1690 1682 PRINT AT 7,SX;V(C),: PRINT 1690 IF E<>2 THEN GO TO 1720 1700 LET V(2)=VAL "INT (V(8)*V(6)/V(PI)*(1-(1+V(PI)/V(6))^(-V(6)*Y))*100+.5)/100" 1710 GO SUB 5120 1720 IF E<>3 THEN GO TO 1860 1730 LET V(PI)=.99 1740 LET I=0 1750 LET R=VAL "INT (V(2)*V(3)/V(6)*(1/((1+V(3)/V(6))^(V(6)*Y)-1)+1)*100+.5)/100" 1760 LET TE=ABS (V(PI)-I)/2 1770 LET I=V(PI) 1780 IF ABS (R-V(8))<.005 THEN GO TO 1840 1790 IF R4 THEN GO TO 1890 1870 LET V(4)=.4342945*LN (V(6)*V(8)/(V(6)*V(8)-V(PI)*V(2)))/(V(6)*.4342945*LN (1+V(PI)/V(6))) 1880 GO SUB 5180 1890 IF E<>8 THEN GO TO 710 1900 LET V(8)=VAL "INT (V(2)*V(3)/V(6)*(1/((1+V(3)/V(6))^(V(6)*Y)-1)+1)*100+.5)/100" 1910 PRINT 1920 PRINT "REG WITHDRAW :$",V(8) 1930 GO TO 710 1940 CLS 1950 PRINT "6) NET PRESENT VALUE" 1960 PRINT 1970 PRINT "INIT INVEST $", 1980 LET C=1 1990 GO SUB 3950 1991 PRINT AT 2,SX;V(C), 2000 GO SUB 4840 2001 PRINT AT PI,SX;V(C)*100, 2010 GO SUB 4880 2011 PRINT AT 4,SX;V(C), 2020 PRINT "CASH FLOW(+/-)" 2030 PRINT 2040 LET NV=-V(2) 2050 FOR I=1 TO V(4) 2060 PRINT "CASH FLOW-YR #",I 2070 INPUT A$ 2071 PRINT AT I+6,19;A$ 2080 LET A=VAL (A$) 2090 LET NV=NV+A/((V(PI)+1)^I) 2100 NEXT I 2110 LET NV=INT (NV*100+.5)/100 2120 PRINT 2130 PRINT "PRESENT VALUE:$",NV 2140 LET TE=NV 2150 GO SUB 5270 2160 GO TO 710 2170 CLS 2180 PRINT ''''''';"LOANS:" 2200 PRINT "1) REGULAR LOAN PAYMENTS." 2210 PRINT "2) REMAINING LOAN LIABILITY." 2220 PRINT "3) FINAL LOAN PAYMENT." 2230 PRINT "4) SINGLE LOAN PAYMENT." 2240 PRINT "5) LOAN AMORTIZATION SCHEDULE." 2260 PRINT "6) RETURN TO MAIN MENU." 2270 PRINT 2280 PRINT "CHOICE: " 2281 PRINT ''''"NOTE:"'"ENTER ""X"" FOR THE VARIABLE TO BESOLVED. APPLIES ONLY TO THE VARIABLES PRECEDING WITH ""*""." 2290 INPUT A$: LET A=VAL A$ 2310 IF (A<1) OR (A>7) THEN GO TO 2290 2330 IF A=1 THEN GO TO 2360 2331 IF A=2 THEN GO TO 2780 2332 IF A=3 THEN GO TO 2960 2333 IF A=4 THEN GO TO 3120 2334 IF A=5 THEN GO TO 3230 2336 IF A=6 THEN GO TO 200 2360 CLS 2370 PRINT "1) REGULAR LOAN PAYMENTS" 2390 PRINT '"*"; 2400 GO SUB 4790 2401 PRINT AT 2,SX;V(C), 2410 PRINT "*"; 2420 GO SUB 5010 2421 GO SUB 440 2470 IF E=4 THEN GO TO 2490 2480 GO SUB 4920 2481 PRINT AT 6,SX;V(C), 2490 GO SUB 4970 2491 IF E=4 THEN PRINT AT 6,SX;V(C),: GO TO 2500 2492 PRINT AT 7,SX;V(C), 2500 IF E<>2 THEN GO TO 2550 2510 LET V(2)=VAL "INT (V(7)*V(6)/V(3)*(1-(1+V(3)/V(6))^(-V(6)*Y))*100+.5)/100" 2520 PRINT 2530 PRINT "AMT OF PRINC:$",V(2) 2540 GO TO 2760 2550 IF E<>3 THEN GO TO 2690 2560 LET V(PI)=.99 2570 LET I=0 2580 LET P=VAL "INT (V(7)*V(6)/V(3)*(1-((1+V(3)/V(6))^(-V(6)*Y)))*100+.5)/100" 2590 LET TE=ABS (V(PI)-I)/2 2600 LET I=V(PI) 2610 IF ABS (P-V(2))<.005 THEN GO TO 2670 2620 IF P4 THEN GO TO 2720 2700 LET V(4)=-.4342945*LN (1-V(PI)*V(2)/(V(6)*V(7)))/(V(6)*.4342945*LN (V(PI)/V(6)+1)) 2710 GO SUB 5180 2720 IF E<>7 THEN GO TO 2760 2730 LET V(7)=VAL "INT (V(PI)*V(2)/(V(6)*(1-(V(PI)/V(6)+1)^(-V(6)*Y)))*100+.5)/100" 2740 PRINT 2750 PRINT "REQ PAYMENT: $",V(7) 2760 GO SUB 5330 2770 GO TO 2170 2780 CLS 2790 PRINT "2) REMAINING LOAN LIABILITY" 2800 PRINT 2810 GO SUB 4790 2811 PRINT AT 2,SX;V(C), 2820 GO SUB 5010 2821 GO SUB 450 2840 GO SUB 4970 2841 PRINT AT 5,SX;V(C), 2850 PRINT "LAST PAYMENT"'"# WAS:" 2860 INPUT A$ 2870 LET A=VAL (A$) 2871 PRINT AT 7,SX;A 2880 FOR J=1 TO A 2890 LET I=INT (P*V(PI)/V(6)*100+.5)/100 2900 LET P=P+I-V(7) 2910 NEXT J 2920 LET LI=INT (P*100+.5)/100 2930 PRINT 2940 PRINT "REMAINING LOAN"'"AFTER >";A;"<" 2941 PRINT "PAYMENTS IS: $ ";LI 2950 GO TO 2760 2960 CLS 2970 PRINT "3) FINAL LOAN PAYMENT" 2980 PRINT 2990 GO SUB 4790 2991 PRINT AT 2,SX;V(C), 3000 GO SUB 5010 3001 GO SUB 450 3020 GO SUB 460 3030 GO SUB 4970 3031 PRINT AT 8,SX;V(C), 3040 FOR J=1 TO V(6)*Y 3050 LET I=INT (P*V(PI)/V(6)*100+.5)/100 3060 LET P=P+I-V(7) 3070 NEXT J 3080 LET LP=INT (P*100+.5)/100+V(7) 3090 PRINT 3100 PRINT "LAST PAYMENT:$",LP 3110 GO TO 2760 3120 CLS 3130 PRINT "4) SINGLE LOAN PAYMENT" 3140 PRINT 3150 GO SUB 4790 3151 PRINT AT 2,SX;V(C), 3160 GO SUB 4840 3161 PRINT AT PI,SX;V(C)*100, 3170 GO SUB 5050 3171 PRINT AT 5,SX;V(4), 3172 PRINT AT 6,SX;V(5), 3180 GO SUB 4970 3181 PRINT AT 7,SX;V(C), 3190 LET V(1)=VAL "INT (V(2)*(1+V(PI)/V(6))^(Y*V(6))*100+.5)/100" 3200 PRINT 3210 PRINT "TOTAL OWED:$",V(1) 3220 GO TO 2760 3230 LET C5=0 3240 LET N5=0 3250 LET F=0 3260 LET P1=0 3270 LET I1=0 3280 CLS 3290 PRINT "5) LOAN AMORTIZATION SCHEDULE" 3300 PRINT 3310 GO SUB 4790 3311 PRINT AT 2,SX;V(C), 3320 GO SUB 5010 3321 GO SUB 450 3340 GO SUB 460 3350 PRINT "# YR PAYMENTS", 3360 GO SUB 3950 3361 PRINT AT 8,SX;V(C), 3370 PRINT "ENTER THE MONTH"'"# IN WHICH THE"'"LOAN BEGAN" 3371 PRINT AT 11,SX;NE, 3380 INPUT N 3390 LET NE=N 3391 PRINT AT 11,SX;NE, 3400 LET NP=(V(4)*12+V(5))/(12/V(6)) 3410 LET NY=INT (((N-1)+NP)/V(6)+.99) 3420 PRINT "ENTER THE RANGE"'"OF YEARS YOU'D"'"LIKE TO EXAMINE"'"(FIRST, LAST)" 3421 PRINT AT 15,SX;F1;" ";L1 3430 INPUT F1,L1 3431 PRINT AT 15,SX;F1;" ";L1, 3440 IF L1<=NY THEN GO TO 3460 3450 LET L1=NY 3460 FOR X=1 TO L1 3470 IF XNY THEN GO TO 3570 3540 IF N5<>NP THEN GO TO 3570 3550 LET PP=P 3560 LET F=1 3570 IF X13 THEN GO TO 3770 3710 IF X3 THEN GO TO 3990 3970 PRINT V(PI)*100, 3980 GO TO 4000 3990 PRINT V(C), 4000 LET A$="" 4010 INPUT A$ 4020 IF A$="" THEN RETURN 4040 IF A$<>"MR" THEN GO TO 4100 4050 PRINT "MEM=";M;" USE AS VARIABLE HERE (Y/N)" 4060 INPUT A$ 4070 IF A$="N" THEN GO TO 4000 4080 LET V(C)=M 4090 RETURN 4100 IF A$="X" THEN LET V(C)=0: LET E=C: RETURN 4130 LET V(C)=VAL (A$) 4140 IF C<>3 THEN RETURN 4150 LET V(C)=V(C)/100 4160 RETURN 4710 PRINT "*FUTURE VALUE $", 4720 LET C=0 4730 GO SUB 3950 4740 RETURN 4750 PRINT "*PRESENT VALUE$", 4760 LET C=1 4770 GO SUB 3950 4780 RETURN 4790 PRINT "PRINCIPAL $", 4800 LET C=1 4810 GO SUB 3950 4820 LET P=V(C) 4830 RETURN 4840 PRINT "INT RATE %", 4850 LET C=2 4860 GO SUB 3950 4870 RETURN 4880 PRINT "FOR # OF YEARS", 4890 LET C=3 4900 GO SUB 3950 4910 RETURN 4920 PRINT "FOR # OF MONTHS", 4930 LET C=4 4940 GO SUB 3950 4950 LET Y=V(C-1)+V(C)/12 4960 RETURN 4970 PRINT "YRLY PERIODS #", 4980 LET C=5 4990 GO SUB 3950 5000 RETURN 5010 PRINT "PAYMENTS $", 5020 LET C=6 5030 GO SUB 3950 5040 RETURN 5050 PRINT "TERM OF LOAN:" 5060 GO SUB 4880 5070 GO SUB 4920 5080 RETURN 5100 PRINT '"FUTURE VALUE $",V(1): RETURN 5130 PRINT '"REQD INVESTMT $",V(2): RETURN 5160 PRINT '"INT RATE REQD %",V(PI)*100: RETURN 5180 LET V(5)=V(4)-INT (V(4)) 5190 LET V(5)=VAL "INT (INT (12*V(5)*10+.5)/10)" 5200 LET V(4)=INT (V(4)) 5210 IF V(5)<>12 THEN GO TO 5240 5220 LET V(4)=V(4)+1 5230 LET V(5)=0 5250 PRINT '"# YRS & MONTHS:";V(4);" ; ";V(5): RETURN 5270 PRINT 5280 IF TE>=0 THEN GO TO 5310 5290 PRINT "THIS IS A LOSING INVESTMENT." 5300 RETURN 5310 PRINT "THIS IS A PROFITABLE INVESTMENT." 5320 RETURN 5340 PRINT AT 21,0;"TO CONTINUE "; INK 2;"<"; INK 4;"ENTER"; INK 2;">"; INK 0;" COPY "; INK 2;"<"; INK 4;"COPY"; INK 2;">" 5350 LET A$="" 5360 INPUT A$ 5361 IF A$="Z" THEN PRINT AT 21,NOT PI,,: COPY 5362 PRINT INK 4;AT 21,0;" HIT TO CONTINUE ", 5370 IF A$<>"" THEN GO TO 5350 5380 RETURN 5390 CLS 5400 PRINT "LOAN AMORTIZATION SCHEDULE FOR YEAR ",X 5410 PRINT "PRINCIPAL $",V(2),"RATE %",V(PI)*100;"%","PAYMENT $",V(7) 5430 PRINT " # BEG. BAL PRINC INT " 5440 RETURN 5460 RETURN 5500 LET Z=INT (Z*100+.5)/100: DIM K$(9): LET K$=STR$ Z 5501 IF K$(9)=CHR$ 32 THEN LET K$=CHR$ 32+K$( TO 9): GO TO 5501 5502 FOR G=1 TO 9 5503 IF K$(G)="." THEN GO TO 5505 5504 NEXT G 5505 IF G=10 THEN LET K$=K$(4 TO )+".00" 5506 IF G=8 THEN LET K$=K$(2 TO )+"0" 5507 RETURN 9989 STOP 9990 BORDER 2: POKE 23607,60: RETURN 9991 LET typ=2: POKE 23618,9: POKE 23619,39: POKE 23620,2 9992 LET typ=1: POKE 23618,9: POKE 23619,39: POKE 23620,2 9993 LET typ=0: RANDOMIZE USR (torg*256+2-typ): POKE 23607,torg-4: RETURN 9994 BORDER 2: POKE 23658,8: POKE 23609,30: LET TYPE=9994: LET torg=255: CLEAR (256*torg-769): LET torg=255: LET REG=9990: LET BLD=9991: LET MOD=9992: LET ITAL=9993 9995 FOR i=0 TO 79: READ k: POKE (i+256*torg),k: NEXT i: GO SUB 9991: PRINT AT 6,4;"SELECT TYPE OF PRINTING:": GO SUB 9990: PRINT AT 9,6;"1 REGULAR REG": GO SUB 9991: PRINT AT 11,6;"2 MODERN MOD": GO SUB 9992: PRINT AT 13,6;"3 BOLD BLD": GO SUB 9993: PRINT AT 15,6;"4 ITALIC ITAL": GO SUB 9991: INPUT "ENTER TYPE OF PRINTING REG / MOD / BLD / ITAL :";Z: GO SUB Z: GO TO 100 9996 DATA 0,NOT PI,121,203,39,203,39,50,21,255,33,NOT PI,61,17,NOT PI,torg-3 9997 DATA 1,NOT PI,3,126,24,48,203,63,24,44,230,112,24,37,121,230,7,203,39,50,40,255,126,24,30,24,28,24,16,24,14,24,14,24,20,24,18,24,2,200,63,203,63,24,10,203,39,203,39,24,4,183,203,39,182,18,35,19,11,120,177,32,196,201 9998 SAVE "INVES/LOAN" LINE 9994: PRINT #1;" REWIND THE TAPE *** AND PLAY ** ": VERIFY "" ```