This listing contains two related financial programs saved as “INTEREST” and “LOAN,” both authored by D. Lipinski Software (copyright 1983). The INTEREST program offers six calculation modes including period-by-period interest listing, future value of single amounts, required interest rates to reach a goal, and time required to reach a savings target, using standard compound-interest formulae with exponentiation via the `**` operator. The LOAN program provides approximate and exact loan cost calculations, full amortization schedule generation with optional LPRINT output, extra payment handling, and variable interest rate scheduling stored in a two-dimensional array. Both programs share an identical initialisation block at line 9000 that encodes all numeric constants as arithmetic expressions (e.g., `H=10`, `I=0`, `J=1`, `T=100`) to save memory and use `USR 32736` to detect a machine code routine, printing a marker string if the checksum matches. A computed `GOTO` at line 240 in the LOAN program dispatches to option handlers using `(VAL Z$)*T*H`, i.e., the chosen digit multiplied by 1000.
Program Analysis
Overview and Structure
The listing contains two independent BASIC programs that share virtually identical initialisation routines. The first is saved as INTEREST and covers savings and investment calculations; the second is saved as LOAN and covers borrowing, amortization, and variable-rate schedules. Both programs begin execution by jumping to line 9000, which sets up all numeric constants and string arrays before redirecting to the main menu.
Shared Initialisation Block (Lines 9000–9998)
Both programs use an identical block starting at line 9000 to define all working variables as arithmetic expressions rather than literal numbers, a common memory-saving idiom:
| Variable | Value | Semantic role |
|---|---|---|
H | 10 | Base constant / screen row |
I | 0 | Zero |
J | 1 | One / loop start |
K | 2 | Two / array index |
L | 3 | Three / array index |
O | 4 | Four / array index |
P | 5 | Five / array index |
Q | 6 | Six / array index |
S | 7 | Seven / DIM size |
T | 100 | Rounding multiplier |
U | 40 | Main menu / restart target |
V | 0.5 | Rounding bias (½) |
W | 30 | Used in computed targets |
Y | 20 | Screen column / TAB target |
The DIM A(S) statement (i.e., DIM A(7)) is issued repeatedly throughout both programs to re-initialise the working numeric array before each calculation mode. String arrays B$, J$, and scalar strings C$ through N$ are also built here. Line 9998 uses GOTO U+W (= GOTO 70 in LOAN, GOTO 40-equivalent in INTEREST after CLS) as a computed jump to the title screen.
Machine Code Detection (Line 80)
Both programs test for a machine code routine with IF USR 32736=value THEN PRINT "...". INTEREST checks for the return value 54109 and LOAN for 58279. The USR call jumps to address 32736 in RAM; if a pre-loaded routine is present and returns the expected value, an additional status string is displayed. This is a guard/feature-detection mechanism, not an error handler.
INTEREST Program — Calculation Modes
The INTEREST menu (lines 6000–6035) offers options 0–6, dispatched via direct IF comparisons. The financially significant formulae appear at lines 7185–7203:
- Option 3 — Future value of a single amount:
A(J)*(1+A(K)/A(L))**(A(L)*A(O)) - Option 4 — Required interest rate:
((A(P)/A(J))**(1/(A(L)*A(O)))-1)*A(L) - Option 5 — Future value of regular deposits (annuity-due variant):
A(Q)/(A(K)/A(L))*((1+(A(K)/A(L)))**((A(O)*A(L))+1)-(1+(A(K)/A(L)))) - Option 6 — Time to reach a goal:
LN(A(P)/A(J)) / (LN(1+A(K)/A(L))*A(L))using theLNfunction
All monetary results are rounded to two decimal places using the idiom INT(V + value * T) / T, where V=0.5 and T=100.
LOAN Program — Calculation Modes
The LOAN menu dispatches using the computed GOTO (VAL Z$)*T*H at line 240, which multiplies the digit by 1000 to reach lines 1000, 2000, 3000, 4000, and 5000. Each section handles a distinct function:
- Approximate loan cost — calls
GOSUB U*H(=GOSUB 400) for data entry then displays totals. - Exact loan cost — iterates payment-by-payment accumulating actual interest paid.
- Amortization schedule — prints or LPRINTs a full period-by-period table with columns for interest, principal, and balance.
- Extra payments — uses array
G(C,2)to store additional lump sums against specific payment numbers. - Variable interest rate — stores multiple rate segments in
B(N, S+1)and recomputes payment amounts at each rate change viaGOSUB 4500.
Amortization and Variable Rate Logic
The amortization loop at lines 3238–3470 checks G(C,K) (extra payments or rate changes) each period and calls GOSUB 4500 when a change is flagged. Subroutine 4500 recalculates the payment amount for the remaining balance at the new rate using the standard annuity formula, then saves all state variables into the B matrix for later summary display.
The variable-rate section (option 5, lines 5000–5830) collects rate segments, stores them in G(B,2), then reuses the amortization engine by setting Z$="4" and calling GOSUB 3105, neatly sharing code with the extra-payments path.
Screen Layout and Display Techniques
The title banner printed at line 6005 (INTEREST) and line 70 (LOAN) uses a dense run of block-graphic escape sequences to draw a bordered header containing inverse-video text (the program title and copyright) and the author credit. The C$ string is a 32-character line of ▀ block graphics used as a horizontal rule. Inverse-video text throughout (encoded as %X sequences) highlights prompts and labels such as % %C%A%U%T%I%O%N%, % %E%N%T%E%R%, and % %I%N%P%U%T%.
The K$ variable holds a 32-space padding string; slicing it with K$( TO Y-L) etc. is used to produce variable-length padding inline within larger string expressions, avoiding separate PRINT statements.
Printer Support
Both programs offer optional hard-copy output throughout. Entering 0 at schedule-type prompts activates mirrored LPRINT statements alongside every PRINT statement. Entering ££ at any summary screen triggers a COPY command to produce a screen dump. The LPRINT subroutines at lines 950–990 are shared by both programs and are called from the amortization and variable-rate summary paths.
Notable Bugs and Anomalies
- In LOAN line
4500, variablesA(K)andA(L)are overwritten with rate-change data fromG(C,K)and a remaining-period calculation. On return, the outer amortization loop at line3270uses the modifiedA(P)for payment subtraction, which is correct, butA(L)is permanently shortened, meaning theFOR C=J TO A(L)loop bound is evaluated once at entry and is unaffected — this is safe in ZX81 BASIC where the loop limit is cached. - Line
5210usesLET G(J,2)=Fwith a literal2rather than the constantK, inconsistent with the rest of the program’s style but functionally equivalent. - INTEREST line
6078executesGOTO S*T*H(=GOTO 7000) without any preceding condition guard after line6055buildsX$; this is the dispatch for options 3–6 and is reached only whenCODE Z$is in range 51–54 (characters “3”–”6″), so the logic is correct despite appearing unconditional. - LOAN line
555usesIF C<=J THEN GOTO U(exits if payments ≤ 1), but the prompt asks for the total number of payments, so a value of exactly 1 is rejected — arguably a minor off-by-one in the validation.
Content
Source Code
5 SAVE "INTERES%T"
20 FAST
40 CLS
50 CLEAR
60 GOTO 9000
80 IF USR 32736=54109 THEN PRINT "+% % % % "
100 GOTO 6005
900 REM
910 PRINT AT H,I;C$;"TOTAL ";B$(K),"$";A(Q)
920 PRINT "TOTAL COST","$";A(J)+A(Q)
930 PRINT C$;"% %E%N%D% %O%F% %C%A%L%C%U%L%A%T%I%O%N% "
940 RETURN
950 REM
960 LPRINT C$;"TOTAL ";B$(K),"$";A(Q)
970 LPRINT "TOTAL COST","$";A(Q)+A(J)
980 LPRINT "% %E%N%D% %O%F% %C%A%L%C%U%L%A%T%I%O%N%S% "
990 RETURN
\n6000 CLS
\n6005 PRINT "\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\##\;;% % % % % % % % INTEREST % % %C% %1%9%8%3% % \;;\##\##\##\;;% \: BY D. LIPINSKI SOFTWARE\ :\;;\##\##\##\##\##\##\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\##\##\##"
\n6010 PRINT "WHAT DO YOU WISH TO DO?",C$
\n6015 PRINT "0 = EXIT.",,"1 = LIST INTEREST BY PERIOD WITH A SINGLE AMOUNT.","2 = LIST INTEREST BY PERIOD WITH REGULAR DEPOSITS."
\n6020 PRINT "3 = LIST VALUE OF A SINGLE"," AMOUNT IN X YEARS.","4 = LIST INTEREST RATE REQUIRED TO REACH A GOAL IN X YEARS SINGLE AMOUNT."
\n6025 PRINT "5 = FIND VALUE OF NEW ACCOUNT WITH A REGULAR DEPOSIT ONLY."
\n6028 PRINT "6 = LIST TIME REQUIRES TO REACH A GOAL WITH A SINGLE AMOUNT."
\n6030 PRINT H$,D$
\n6035 INPUT Z$
\n6037 DIM A(S)
\n6040 IF Z$="0" THEN STOP
\n6045 IF Z$="1" OR Z$="2" THEN GOTO 6080
\n6050 IF CODE Z$<=30 OR CODE Z$>=35 THEN GOTO 6000
\n6055 LET X$=K$+H$+" 0 = EXIT"+K$( TO Y+O)+D$
\n6078 GOTO S*T*H
\n6080 CLS
\n6085 IF Z$="1" THEN GOTO 6120
\n6090 PRINT C$;"WHAT IS THE AMOUNT YOU ARE GOINGTO DEPOSIT EACH COMPOUNDING PERIOD?",,K$;"% %N%O%T%E% THIS WILL RECEIVE NO INTEREST FOR THE DEPOSIT PERIOD.THIS WILL MEAN THAT THE ACTUAL VALUE IN YOUR ACCOUNT MAY BE MORE THAN LISTED HERE, DEPENDINGON THE ACTUAL WAY THAT YOUR INVESTMENT IS TREATED."
\n6095 PRINT K$;H$,D$
\n6100 INPUT C
\n6105 IF C<I THEN GOTO 6080
\n6110 LET A(Q)=C
\n6120 CLS
\n6125 PRINT C$;E$;"THE STARTING ";B$(J);H$,TAB H+J;"0 = EXIT",TAB P;D$
\n6130 INPUT C
\n6135 IF C=I THEN GOTO U
\n6145 LET A(J)=C
\n6150 CLS
\n6155 PRINT C$;E$;B$(K);" RATE?","ENTER IN DECIMAL FIGURE ONLY."
\n6160 PRINT K$;"EXAMPLE 5 3/4\ '/\. = .0575"
\n6165 PRINT H$,D$
\n6170 INPUT C
\n6175 IF C>=J THEN GOTO 6150
\n6180 LET A(K)=C
\n6185 CLS
\n6190 PRINT C$;E$;B$(K);" COMPOUND ",B$(O)
\n6200 PRINT "12=";J$(Q+Q)," 2=";J$(K)," 4=";J$(O)," 1=";J$(J)
\n6210 PRINT H$,D$
\n6220 INPUT C
\n6230 LET A(L)=C
\n6240 CLS
\n6250 PRINT N$
\n6290 PRINT G$,D$
\n6300 INPUT Z$
\n6310 IF Z$="£" THEN GOTO U
\n6320 IF Z$="1" OR Z$="0" THEN GOTO 6330
\n6325 GOTO 6240
\n6330 CLS
\n6335 LET X$="PERIOD INTEREST AMOUNT $ $"
\n6337 LET B=I
\n6340 LET C=I
\n6345 PRINT C$;TAB 8;"INTEREST EARNED",K$;"STARTING AMOUNT","$";A(J),"$ ADDED/PERIOD","$";A(Q),"INTEREST",A(K);"\ '/\. ","COMPOUND PERIOD",J$(A(L)),K$;C$
\n6350 IF Z$="0" THEN LPRINT C$;TAB 8;"INTEREST EARNED",K$;"STARTING AMOUNT","$";A(J),"$ ADDED/PERIOD","$";A(Q),"INTEREST",A(K);"\ '/\. ","COMPOUND PERIOD",J$(A(L)),K$;C$
\n6355 PRINT K$;I$,G$,D$
\n6357 INPUT Y$
\n6360 IF Z$="0" THEN LPRINT X$
\n6370 IF Z$="0" THEN LPRINT C;TAB Y-J;A(J)
\n6380 LET A(P)=A(J)
\n6390 LET R=A(K)/A(L)
\n6400 CLS
\n6410 FOR D=J TO H+K
\n6420 LET Y$=""
\n6430 LET A(O)=INT (V+(A(J)*R)*T)/T
\n6440 LET A(J)=INT (V+(A(J)+A(O))*T)/T
\n6450 LET C=C+J
\n6455 LET B=B+J
\n6460 LET A(J)=A(J)+A(Q)
\n6470 IF D=J THEN PRINT C$;X$
\n6480 PRINT C;TAB S+J;A(O);;TAB Y-J;A(J)
\n6490 IF Z$="0" THEN LPRINT C;TAB S+J;A(O);TAB Y-J;A(J)
\n6500 NEXT D
\n6510 PRINT K$;I$,G$,D$
\n6520 INPUT Y$
\n6530 IF Y$="£" THEN GOTO 6600
\n6540 GOTO 6400
\n6600 CLS
\n6610 PRINT C$;TAB H;"TOTALS"
\n6620 PRINT X$
\n6630 PRINT C;TAB S+J;A(J)-A(P)-(A(Q)*B);TAB Y-J;A(J)
\n6635 PRINT K$;"AMOUNT INVESTED $";A(P)+A(Q)*B
\n6640 PRINT K$;I$,D$
\n6650 IF Z$="0" THEN LPRINT C$
\n6660 IF Z$="0" THEN LPRINT TAB H;"TOTALS"
\n6670 IF Z$="0" THEN LPRINT C;TAB S+J;A(J)-A(P)-(A(Q)*B);TAB Y-J;A(J)
\n6675 IF Z$="0" THEN LPRINT K$;"AMOUNT INVESTED $";A(P)+(A(Q)*B)
\n6680 INPUT Y$
\n6690 GOTO U
\n7000 IF Z$="5" THEN GOTO 7030
\n7005 CLS
\n7010 PRINT K$;E$;"AMOUNT YOU WISH TO START WITH?",,X$
\n7015 INPUT C
\n7020 IF C<=I THEN GOTO U
\n7025 LET A(J)=C
\n7030 IF Z$="4" THEN GOTO 7070
\n7035 CLS
\n7040 PRINT C$;E$;B$(K);" RATE?",,,"ENTER IN DECIMAL FIGURE ONLY."
\n7045 PRINT C$;"MUST BE LESS THAN 1","EXAMPLE 5 3/4\ '/\. = .0575",X$
\n7050 INPUT C
\n7055 IF C<=I THEN GOTO U
\n7060 IF C>=J THEN GOTO 7035
\n7065 LET A(K)=C
\n7075 CLS
\n7080 PRINT C$;E$;"NUMBER OF TIMES PER YEAR THE INTEREST IS COMPOUNDED?";X$
\n7085 INPUT C
\n7090 IF C<=I THEN GOTO U
\n7095 LET A(L)=C
\n7096 IF Z$="6" THEN GOTO 7125
\n7100 CLS
\n7105 PRINT C$;E$;"NUMBER OF YEARS YOU WISH TO CALCULATE?",X$
\n7110 INPUT C
\n7115 IF C<=I THEN GOTO U
\n7120 LET A(O)=C
\n7125 IF Z$="3" OR Z$="5" THEN GOTO 7155
\n7130 CLS
\n7135 PRINT C$;E$;"AMOUNT YOU WISH TO REACH?",,X$
\n7140 INPUT C
\n7145 IF C<=I THEN GOTO U
\n7150 LET A(P)=C
\n7155 IF Z$<>"5" THEN GOTO 7185
\n7160 CLS
\n7165 PRINT K$;E$;"AMOUNT YOU WISH TO DEPOSIT EACH COMPOUNDING PERIOD?";X$
\n7170 INPUT C
\n7175 IF C<=I THEN GOTO U
\n7180 LET A(Q)=C
\n7185 IF Z$="3" THEN LET A(S)=INT (V+(A(J)*(J+A(K)/A(L))**(A(L)*A(O)))*T)/T
\n7190 IF Z$="4" THEN LET A(S)=INT (V+(((A(P)/A(J))**(J/(A(L)*A(O)))-J)*A(L))*T)/T
\n7195 IF Z$="5" THEN LET A(S)=INT (V+(A(Q)/(A(K)/A(L))*((J+(A(K)/A(L)))**((A(O)*A(L))+J)-(J+(A(K)/A(L)))))*T)/T
\n7201 IF Z$="6" THEN LET BB=LN (A(P)/A(J))
\n7202 IF Z$="6" THEN LET BC=LN (J+A(K)/A(L))*A(L)
\n7203 IF Z$="6" THEN LET A(S)=INT ((V+(BB/BC)*T))/T
\n7205 CLS
\n7206 PRINT C$
\n7210 IF Z$="5" THEN GOTO 7220
\n7215 PRINT "STARTING AMOUNT";TAB Y;"$";A(J)
\n7220 IF Z$="4" THEN GOTO 7230
\n7225 PRINT "INTEREST RATE";TAB Y;A(K)*T;"\ '/\. "
\n7230 IF Z$="6" THEN GOTO 7245
\n7235 PRINT "NUMBER OF YEARS";TAB Y;A(O)
\n7240 IF Z$<>"4" THEN GOTO 7250
\n7245 PRINT "GOAL TO REACH";TAB Y;"$";A(P)
\n7250 PRINT "COMPOUND PER YEAR";TAB Y;A(L)
\n7255 IF Z$="3" THEN PRINT C$;"VALUE AT END","$";A(S)
\n7260 IF Z$="4" THEN PRINT C$;"INTEREST REQUIRED",A(S)*T;"\ '/\. "
\n7265 IF Z$="5" THEN PRINT "DEPOSIT AMOUNT";TAB Y;"$";A(Q)
\n7270 IF Z$="5" THEN PRINT "TOTAL DEPOSITS";TAB Y;"$";A(Q)*A(L)*A(O)
\n7275 IF Z$="3" OR Z$="5" THEN PRINT C$;"MINIMUM VALUE","$";A(S)
\n7280 IF Z$="6" THEN PRINT C$;"YEARS REQUIRED",A(S)
\n7285 PRINT AT Y-K,I;C$;F$,I$,D$
\n7290 INPUT Y$
\n7295 IF Y$<>"££" THEN GOTO U
\n7300 PRINT AT Y-J,I;K$;K$;K$
\n7305 COPY
\n7310 GOTO U
\n9000 REM
\n9010 LET H=10
\n9011 LET I=H-H
\n9012 LET J=H/H
\n9020 LET K=J+J
\n9030 LET L=K+J
\n9040 LET O=L+J
\n9050 LET P=O+J
\n9060 LET Q=P+J
\n9070 LET S=Q+J
\n9080 LET T=H*H
\n9090 LET U=H*O
\n9100 LET V=J/K
\n9110 LET W=H*L
\n9120 LET Y=H*K
\n9150 DIM B$(P,S+J)
\n9160 LET B$(J)="AMOUNT"
\n9170 LET B$(K)="INTEREST"
\n9180 LET B$(L)="NUMBER"
\n9190 LET B$(O)="PERIOD"
\n9200 LET B$(P)="PAYMENT"
\n9210 LET C$="\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''"
\n9220 LET D$="% %I%N%P%U%T% %A%N%S%W%E%R% %P%L%E%A%S%E% "
\n9230 LET E$="WHAT IS THE "
\n9240 LET F$="££ = COPY THIS TO THE PRINTER "
\n9250 LET G$="ANSWER £ TO EXIT "
\n9260 LET H$="% %C%A%U%T%I%O%N% INPUT NUMBERS ONLY"
\n9270 LET I$="PRESS % %E%N%T%E%R% TO CONTINUE"
\n9280 DIM J$(H+K,H+K)
\n9290 LET J$(J)="ANNUAL"
\n9300 LET J$(O)="QUARTERLY"
\n9310 LET J$(K)="SEMI ANNUAL"
\n9330 LET J$(H+K)="MONTHLY"
\n9340 LET K$=" "
\n9350 LET L$=K$+"WHAT IS THE TOTAL NUMBER OF THE SCHEDULED PAYMENTS? "+K$+"INPUT 0 TO EXIT"+K$( TO Y-L)+H$+K$( TO O)+D$
\n9360 LET M$=C$+"THIS WILL LET YOU PICK EXTRA PAYMENT ON ANY PAYMENT NUMBER YOU DESIRE"
\n9370 LET N$=C$+"WHAT DO YOU WISH TO DO? "+K$+"1 = VIEW SCHEDULE ON SCREEN ONLY0 = VIEW AND PRINT BOTH"
\n9998 GOTO U+W
\n9999 PRINT ,,PEEK 16386-PEEK 16412+256*(PEEK 16387-PEEK 16413)-50
5 SAVE "LOA%N"
20 FAST
40 CLS
50 CLEAR
60 GOTO 9000
70 PRINT "\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\!!\##\;;% % % % % % % % % % MONEY % % %C% %1%9%8%3% % % \;;\##\##\##\;;% \: BY D. LIPINSKI SOFTWARE\ :\;;\##\##\##\##\##\##\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\;;\##\##\##"
80 IF USR 32736=58279 THEN PRINT "4% % % % % % % "
110 PRINT C$,,"0 = EXIT",,"1 = APPROXIMATE LOAN RATES"
120 PRINT "2 = CALCULATE EXACT LOAN COST"
130 PRINT "3 = PRINT AMORTIZATION SCHEDULE"
140 PRINT "4 = ADD EXTRA PAYMENTS TO LOAN"
150 PRINT "5 = VARIABLE INTEREST RATE"
200 PRINT
210 PRINT C$;"WHAT DO YOU WISH TO DO?",D$
220 INPUT Z$
225 IF Z$="0" THEN STOP
230 IF CODE Z$<=W-K OR CODE Z$>=W+O THEN GOTO U
240 GOTO (VAL Z$)*T*H
395 GOTO U
400 REM
440 PRINT C$;E$;B$(J);"OF THE LOAN?",,H$,D$
450 INPUT C
460 LET A(J)=C
470 CLS
480 PRINT C$;E$;B$(K);" RATE OF THELOAN?",,"ENTER IN DECIMAL FIGURE ONLY."
490 PRINT C$;"MUST BE LESS THAN 1","EXAMPLE 10 3/4\ '/\. = .1075"
500 PRINT ,,H$,D$
510 INPUT C
515 IF C>=J THEN GOTO 470
520 LET A(K)=C
530 CLS
540 PRINT L$
550 INPUT C
555 IF C<=J THEN GOTO U
560 LET A(L)=INT (C+V)
570 CLS
580 PRINT C$;E$;B$(P);B$(O)
590 PRINT "12=";J$(H+K)," 2=";J$(K)," 4=";J$(O)," 1=";J$(J)
595 PRINT ,,H$,D$
600 INPUT C
610 LET A(O)=INT (C+V)
620 CLS
630 PRINT C$;E$;B$(P);B$(J),"ENTER 0 FOR COMPUTER TO SET THE AMOUNT FOR YOU"
640 PRINT ,,H$,D$
670 INPUT C
672 IF C<>I THEN LET A(P)=C
674 IF Z$="3" THEN GOTO 680
675 IF C<>I THEN GOTO 2105
680 LET R=A(K)/A(O)
690 IF C=I THEN LET C=INT (V+A(J)*(R/(J-(J+R)**(-A(L))))*T)/T
700 LET A(P)=C
705 LET A(Q)=A(P)*A(L)-A(J)
710 CLS
720 GOSUB 760
725 PRINT AT Y-J,I;"IS THIS CORRECT? ENTER Y OR N",D$
730 INPUT Y$
735 IF Y$="Y" THEN RETURN
740 GOTO U
760 REM
765 CLS
770 PRINT AT I,I;C$;B$(J),"$";A(J)
780 PRINT B$(K),A(K)*T;"\ '/\. "
790 PRINT B$(L);B$(P);A(L)
800 PRINT B$(O),J$(A(O))
810 PRINT B$(P),"$";A(P)
815 IF Z$="1" THEN GOSUB 900
820 PRINT AT Y-K,I;C$;F$,I$,D$
830 INPUT Y$
840 PRINT AT Y-J,I;K$;K$;K$
850 IF Y$<>"££" THEN RETURN
860 COPY
870 RETURN
900 REM
910 PRINT AT H,I;C$;"TOTAL ";B$(K),"$";A(Q)
920 PRINT "TOTAL COST","$";A(J)+A(Q)
930 PRINT C$;"% %E%N%D% %O%F% %C%A%L%C%U%L%A%T%I%O%N% "
940 RETURN
950 REM
960 LPRINT C$;"TOTAL ";B$(K),"$";A(Q)
970 LPRINT "TOTAL COST","$";A(Q)+A(J)
980 LPRINT "% %E%N%D% %O%F% %C%A%L%C%U%L%A%T%I%O%N%S% "
990 RETURN
\n1000 CLS
\n1020 PRINT C$
\n1030 PRINT TAB 5;"APPROXIMATE LOAN COST"
\n1040 PRINT
\n1070 DIM A(S)
\n1100 GOSUB U*H
\n1130 GOTO U
\n2000 CLS
\n2020 PRINT C$;TAB 8;"EXACT LOAN COST"
\n2030 PRINT C$;"THIS PROCESS WILL TAKE TIME TO CALCULATE SO DO NOT PRESS THE BREAK KEY DURING THE CYCLE"
\n2040 PRINT G$
\n2050 PRINT I$,D$
\n2060 INPUT Y$
\n2070 IF Y$="£" THEN GOTO U
\n2090 DIM A(S)
\n2095 CLS
\n2100 GOSUB U*H
\n2102 CLS
\n2105 REM
\n2110 LET A(S)=A(J)
\n2120 LET R=A(K)/A(O)
\n2125 LET A(Q)=I
\n2130 FOR C=J TO A(L)
\n2135 IF A(S)<=I THEN GOTO 2180
\n2140 LET D=INT (V+A(S)*R*T)/T
\n2145 LET A(L)=C
\n2150 LET A(Q)=A(Q)+D
\n2160 LET A(S)=INT (V+(A(S)-(A(P)-D))*T)/T
\n2170 NEXT C
\n2180 IF Z$="1" THEN GOTO 710
\n2185 LET Z$="1"
\n2190 GOSUB 760
\n2195 GOTO U
\n3000 CLS
\n3020 PRINT C$;TAB P;"AMORTIZATION SCHEDULE"
\n3040 PRINT G$
\n3050 PRINT I$,D$
\n3060 INPUT Y$
\n3070 IF Y$="£" THEN GOTO U
\n3090 DIM A(S)
\n3095 CLS
\n3100 GOSUB U*H
\n3105 REM
\n3110 CLS
\n3120 PRINT N$
\n3150 PRINT "5 = SEND TO PRINTER ONLY"
\n3170 PRINT G$
\n3180 INPUT X$
\n3185 IF X$="1" OR X$="5" OR X$="0" THEN GOTO 3200
\n3190 IF X$="£" THEN GOTO U
\n3195 GOTO 3110
\n3200 CLS
\n3205 IF Z$<>"4" THEN DIM G(A(L),K)
\n3210 LET A(S)=A(J)
\n3220 LET R=A(K)/A(O)
\n3224 PRINT "NR, INTEREST PRICIPAL BALANCE"
\n3226 PRINT "0";TAB L;"$";TAB H+K;"$";TAB Y+K;"$";A(J)
\n3230 IF X$="5" OR X$="0" THEN LPRINT "NR. INTEREST PRINCIPAL BALANCE"
\n3231 IF X$="5" OR X$="0" THEN LPRINT "0";TAB L;"$";TAB H+K;"$";TAB Y+K;"$";A(J)
\n3232 LET E=O
\n3235 LET A(Q)=I
\n3238 FOR C=J TO A(L)
\n3239 IF A(S)<=I THEN GOTO 3480
\n3240 IF G(C,K)<>I THEN GOSUB 4500
\n3245 LET D=INT (V+A(S)*R*T)/T
\n3250 LET A(Q)=A(Q)+D
\n3260 LET E=E+J
\n3270 LET A(S)=INT (V+(A(S)-G(C,J)-(A(P)-D))*T)/T
\n3280 PRINT C;TAB O;INT (V+D*T)/T;TAB H+L;INT (V+(A(P)+G(C,J)-D)*T)/T;TAB Y+L;A(S)
\n3290 IF X$="5" OR X$="0" THEN LPRINT C;TAB O;INT (V+D*T)/T;TAB H+L;INT (V+(A(P)+G(C,J)-D)*T)/T;TAB Y+L;A(S)
\n3300 IF X$="5" THEN GOTO 3340
\n3310 IF E<=Y-K THEN GOTO 3470
\n3320 PRINT C$;G$,I$,D$
\n3330 INPUT Y$
\n3335 IF Y$="£" THEN GOTO U
\n3340 CLS
\n3350 LET E=J
\n3470 NEXT C
\n3490 PRINT K$;I$
\n3500 INPUT Y$
\n3510 CLS
\n3520 FAST
\n3525 IF Z$="4" THEN RETURN
\n3526 REM
\n3530 IF X$="5" OR X$="0" THEN GOSUB 950
\n3540 GOSUB 900
\n3550 PRINT I$,D$
\n3560 INPUT Y$
\n3570 GOTO U
\n4000 CLS
\n4020 PRINT M$
\n4030 PRINT L$
\n4050 INPUT C
\n4055 IF C<=I THEN GOTO U*T
\n4060 DIM G(C,K)
\n4065 REM
\n4070 CLS
\n4080 PRINT C$;"WHAT IS THE PAYMENT NUMBER YOU WISH A ADD AN ADDITIONAL AMOUNT TO?",,"0 = COMPLETE GOTO PRINT SCHEDULE";H$,D$
\n4090 INPUT E
\n4100 IF Z$="5" AND E=0 THEN RETURN
\n4105 IF E>C THEN GOTO 4070
\n4110 CLS
\n4114 IF E=I AND Z$="5" THEN RETURN
\n4115 IF E=I THEN GOTO 4160
\n4120 PRINT C$;"WHAT IS THE AMOUNT OF ADDED PAYMENT?",,H$,D$
\n4130 INPUT B
\n4140 LET G(E,J)=B
\n4150 GOTO 4070
\n4160 GOSUB W*T
\n4170 GOTO 3526
\n4500 REM
\n4510 LET M=M+J
\n4520 LET A(K)=G(C,K)
\n4530 LET A(L)=A(L)-C
\n4540 LET R=A(K)/A(O)
\n4550 LET D=INT (V+A(S)*(R/(J-(J+R)**(-A(L))))*T)/T
\n4600 LET A(P)=D
\n4610 LET B(M,J)=A(S)
\n4620 LET B(M,K)=A(K)
\n4630 LET B(M,L)=A(L)
\n4640 LET B(M,O)=A(O)
\n4650 LET B(M,P)=A(P)
\n4660 LET B(M,Q)=A(Q)
\n4670 LET B(M,S)=A(S)
\n4680 LET B(M,S+J)=C
\n4690 RETURN
\n5000 CLS
\n5020 PRINT C$;"THIS WILL ALLOW YOU TO COMPUTE AND PRINT A LOAN SCHEDULE THAT HAS A VARIABLE INTEREST RATE ANDWILL ALSO ALLOW EXTRA PAYMENTS AT ANY GIVEN TIME."
\n5030 PRINT L$
\n5040 INPUT C
\n5050 IF C<=I THEN GOTO U
\n5060 DIM G(C,K)
\n5080 CLS
\n5090 PRINT K$;"WHAT IS THE TOTAL NUMBER OF INTEREST RATES?",,K$;"INPUT 0 TO EXIT",,H$,D$
\n5100 INPUT N
\n5110 IF N<=I THEN GOTO U
\n5130 FOR D=J TO N
\n5140 CLS
\n5150 PRINT K$;TAB O;"INTEREST RATE NUMBER ";D
\n5160 PRINT C$;E$;B$(K);" RATE?",,,"ENTER IN DECIMAL FIGURE ONLY."
\n5170 PRINT C$;"MUST BE LESS THAN 1","EXAMPLE 10 3/4\ '/\. = .1075"
\n5180 PRINT ,,H$,D$
\n5190 INPUT F
\n5200 IF F>=J THEN GOTO 5140
\n5210 IF D=J THEN LET G(J,2)=F
\n5220 IF D=J THEN NEXT D
\n5230 PRINT C$;"AT WHAT PAYMENT NUMBER DOES THISRATE START?",,H$,D$
\n5240 INPUT B
\n5250 IF B<=I OR B>C THEN GOTO 5230
\n5270 LET G(B,K)=F
\n5280 NEXT D
\n5290 CLS
\n5300 PRINT M$
\n5310 PRINT K$;G$,I$,D$
\n5320 INPUT Y$
\n5330 IF Y$="£" THEN GOTO 5350
\n5340 GOSUB 4065
\n5350 CLS
\n5360 PRINT C$;E$;B$(J);"OF THE LOAN?",,H$,D$
\n5370 INPUT D
\n5380 CLS
\n5390 PRINT C$;E$;B$(P);B$(O)
\n5400 PRINT "12=";J$(H+K)," 6=";J$(Q)," 4=";J$(O)," 1=";J$(J)
\n5410 PRINT ,,H$,D$
\n5420 INPUT F
\n5430 CLS
\n5450 LET M=J
\n5470 DIM A(S)
\n5480 DIM B(N,S+J)
\n5490 LET B(J,J)=D
\n5500 LET B(J,K)=G(J,K)
\n5510 LET B(J,L)=C
\n5520 LET B(J,O)=F
\n5530 LET B(J,S)=D
\n5535 LET B(J,S+J)=J
\n5540 LET R=B(J,K)/B(J,O)
\n5550 LET C=INT (V+B(J,J)*(R/(J-(J+R)**(-B(J,L))))*T)/T
\n5560 LET B(J,P)=C
\n5570 FOR Z=J TO S
\n5580 LET A(Z)=B(J,Z)
\n5590 NEXT Z
\n5600 LET G(J,K)=I
\n5605 LET Z$="4"
\n5610 GOSUB 3105
\n5620 CLS
\n5630 FOR Z=J TO N-J
\n5640 LET B(Z,Q)=B(Z+J,Q)-B(Z,Q)
\n5650 NEXT Z
\n5670 LET B(N,Q)=A(Q)-B(N,Q)
\n5680 FOR Z=J TO N
\n5685 CLS
\n5690 PRINT K$;TAB S+J;"RATE NUMBER ";Z
\n5700 PRINT K$;B$(J),"$";B(Z,J)
\n5710 PRINT B$(K);" RATE",B(Z,K)*T;"\ '/\. "
\n5720 PRINT B$(P);B$(L),B(Z,L)
\n5730 PRINT B$(O),J$(B(Z,O))
\n5740 PRINT B$(P),"$";B(Z,P)
\n5750 PRINT "INT THIS RATE","$";B(Z,Q)
\n5760 PRINT AT Y-K,I;C$;F$,I$,D$
\n5766 IF Z=N THEN GOSUB 900
\n5770 INPUT Y$
\n5774 PRINT AT Y-J,I;K$;K$;K$
\n5780 IF Y$="££" THEN COPY
\n5790 IF Y$="££" THEN GOTO 5810
\n5800 IF X$="5" OR X$="0" THEN COPY
\n5810 NEXT Z
\n5820 IF X$="5" OR X$="0" THEN GOSUB 950
\n5830 GOTO U
\n9000 REM
\n9010 LET H=10
\n9011 LET I=H-H
\n9012 LET J=H/H
\n9020 LET K=J+J
\n9030 LET L=K+J
\n9040 LET O=L+J
\n9050 LET P=O+J
\n9060 LET Q=P+J
\n9070 LET S=Q+J
\n9080 LET T=H*H
\n9090 LET U=H*O
\n9100 LET V=J/K
\n9110 LET W=H*L
\n9120 LET Y=H*K
\n9150 DIM B$(P,S+J)
\n9160 LET B$(J)="AMOUNT"
\n9170 LET B$(K)="INTEREST"
\n9180 LET B$(L)="NUMBER"
\n9190 LET B$(O)="PERIOD"
\n9200 LET B$(P)="PAYMENT"
\n9210 LET C$="\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''"
\n9220 LET D$="% %I%N%P%U%T% %A%N%S%W%E%R% %P%L%E%A%S%E% "
\n9230 LET E$="WHAT IS THE "
\n9240 LET F$="££ = COPY THIS TO THE PRINTER "
\n9250 LET G$="ANSWER £ TO EXIT "
\n9260 LET H$="% %C%A%U%T%I%O%N% INPUT NUMBERS ONLY"
\n9270 LET I$="PRESS % %E%N%T%E%R% TO CONTINUE"
\n9280 DIM J$(H+K,H+K)
\n9290 LET J$(J)="ANNUAL"
\n9300 LET J$(O)="QUARTERLY"
\n9310 LET J$(K)="SEMI ANNUAL"
\n9330 LET J$(H+K)="MONTHLY"
\n9340 LET K$=" "
\n9350 LET L$=K$+"WHAT IS THE TOTAL NUMBER OF THE SCHEDULED PAYMENTS? "+K$+"INPUT 0 TO EXIT"+K$( TO Y-L)+H$+K$( TO O)+D$
\n9360 LET M$=C$+"THIS WILL LET YOU PICK EXTRA PAYMENT ON ANY PAYMENT NUMBER YOU DESIRE"
\n9370 LET N$=C$+"WHAT DO YOU WISH TO DO? "+K$+"1 = VIEW SCHEDULE ON SCREEN ONLY0 = VIEW AND PRINT BOTH"
\n9998 GOTO U+W
\n9999 PRINT ,,PEEK 16386-PEEK 16412+256*(PEEK 16387-PEEK 16413)-50
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.




