Money Matters

Products: Money Matters
Developer(s): Dale F Lipinski
Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Finance

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:

VariableValueSemantic role
H10Base constant / screen row
I0Zero
J1One / loop start
K2Two / array index
L3Three / array index
O4Four / array index
P5Five / array index
Q6Six / array index
S7Seven / DIM size
T100Rounding multiplier
U40Main menu / restart target
V0.5Rounding bias (½)
W30Used in computed targets
Y20Screen 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 60006035) offers options 0–6, dispatched via direct IF comparisons. The financially significant formulae appear at lines 71857203:

  • 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 the LN function

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:

  1. Approximate loan cost — calls GOSUB U*H (= GOSUB 400) for data entry then displays totals.
  2. Exact loan cost — iterates payment-by-payment accumulating actual interest paid.
  3. Amortization schedule — prints or LPRINTs a full period-by-period table with columns for interest, principal, and balance.
  4. Extra payments — uses array G(C,2) to store additional lump sums against specific payment numbers.
  5. Variable interest rate — stores multiple rate segments in B(N, S+1) and recomputes payment amounts at each rate change via GOSUB 4500.

Amortization and Variable Rate Logic

The amortization loop at lines 32383470 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 50005830) 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 950990 are shared by both programs and are called from the amortization and variable-rate summary paths.

Notable Bugs and Anomalies

  • In LOAN line 4500, variables A(K) and A(L) are overwritten with rate-change data from G(C,K) and a remaining-period calculation. On return, the outer amortization loop at line 3270 uses the modified A(P) for payment subtraction, which is correct, but A(L) is permanently shortened, meaning the FOR 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 5210 uses LET G(J,2)=F with a literal 2 rather than the constant K, inconsistent with the rest of the program’s style but functionally equivalent.
  • INTEREST line 6078 executes GOTO S*T*H (= GOTO 7000) without any preceding condition guard after line 6055 builds X$; this is the dispatch for options 3–6 and is reached only when CODE Z$ is in range 51–54 (characters “3”–”6″), so the logic is correct despite appearing unconditional.
  • LOAN line 555 uses IF 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

Appears On

Related Products

Money and Interest, two programs to perform multiple financial calculations.

Related Articles

Related Content

Image Gallery

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 
 6000 CLS 
 6005 PRINT "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##;;% % % % % % % %  INTEREST % % %C% %1%9%8%3% % ;;######;;% : BY D. LIPINSKI SOFTWARE :;;############;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;######"
 6010 PRINT "WHAT DO YOU WISH TO DO?",C$
 6015 PRINT "0 = EXIT.",,"1 = LIST INTEREST BY PERIOD WITH    A SINGLE AMOUNT.","2 = LIST INTEREST BY PERIOD WITH    REGULAR DEPOSITS."
 6020 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."
 6025 PRINT "5 = FIND VALUE OF NEW ACCOUNT       WITH A REGULAR DEPOSIT ONLY."
 6028 PRINT "6 = LIST TIME REQUIRES TO REACH     A GOAL WITH A SINGLE AMOUNT."
 6030 PRINT H$,D$
 6035 INPUT Z$
 6037 DIM A(S)
 6040 IF Z$="0" THEN STOP 
 6045 IF Z$="1" OR Z$="2" THEN GOTO 6080
 6050 IF CODE Z$<=30 OR CODE Z$>=35 THEN GOTO 6000
 6055 LET X$=K$+H$+"    0 = EXIT"+K$( TO Y+O)+D$
 6078 GOTO S*T*H
 6080 CLS 
 6085 IF Z$="1" THEN GOTO 6120
 6090 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."
 6095 PRINT K$;H$,D$
 6100 INPUT C
 6105 IF C<I THEN GOTO 6080
 6110 LET A(Q)=C
 6120 CLS 
 6125 PRINT C$;E$;"THE STARTING ";B$(J);H$,TAB H+J;"0 = EXIT",TAB P;D$
 6130 INPUT C
 6135 IF C=I THEN GOTO U
 6145 LET A(J)=C
 6150 CLS 
 6155 PRINT C$;E$;B$(K);" RATE?","ENTER IN DECIMAL FIGURE ONLY."
 6160 PRINT K$;"EXAMPLE 5 3/4 '/. = .0575"
 6165 PRINT H$,D$
 6170 INPUT C
 6175 IF C>=J THEN GOTO 6150
 6180 LET A(K)=C
 6185 CLS 
 6190 PRINT C$;E$;B$(K);" COMPOUND ",B$(O)
 6200 PRINT "12=";J$(Q+Q)," 2=";J$(K)," 4=";J$(O)," 1=";J$(J)
 6210 PRINT H$,D$
 6220 INPUT C
 6230 LET A(L)=C
 6240 CLS 
 6250 PRINT N$
 6290 PRINT G$,D$
 6300 INPUT Z$
 6310 IF Z$="£" THEN GOTO U
 6320 IF Z$="1" OR Z$="0" THEN GOTO 6330
 6325 GOTO 6240
 6330 CLS 
 6335 LET X$="PERIOD  INTEREST   AMOUNT              $          $"
 6337 LET B=I
 6340 LET C=I
 6345 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$
 6350 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$
 6355 PRINT K$;I$,G$,D$
 6357 INPUT Y$
 6360 IF Z$="0" THEN LPRINT X$
 6370 IF Z$="0" THEN LPRINT C;TAB Y-J;A(J)
 6380 LET A(P)=A(J)
 6390 LET R=A(K)/A(L)
 6400 CLS 
 6410 FOR D=J TO H+K
 6420 LET Y$=""
 6430 LET A(O)=INT (V+(A(J)*R)*T)/T
 6440 LET A(J)=INT (V+(A(J)+A(O))*T)/T
 6450 LET C=C+J
 6455 LET B=B+J
 6460 LET A(J)=A(J)+A(Q)
 6470 IF D=J THEN PRINT C$;X$
 6480 PRINT C;TAB S+J;A(O);;TAB Y-J;A(J)
 6490 IF Z$="0" THEN LPRINT C;TAB S+J;A(O);TAB Y-J;A(J)
 6500 NEXT D
 6510 PRINT K$;I$,G$,D$
 6520 INPUT Y$
 6530 IF Y$="£" THEN GOTO 6600
 6540 GOTO 6400
 6600 CLS 
 6610 PRINT C$;TAB H;"TOTALS"
 6620 PRINT X$
 6630 PRINT C;TAB S+J;A(J)-A(P)-(A(Q)*B);TAB Y-J;A(J)
 6635 PRINT K$;"AMOUNT INVESTED $";A(P)+A(Q)*B
 6640 PRINT K$;I$,D$
 6650 IF Z$="0" THEN LPRINT C$
 6660 IF Z$="0" THEN LPRINT TAB H;"TOTALS"
 6670 IF Z$="0" THEN LPRINT C;TAB S+J;A(J)-A(P)-(A(Q)*B);TAB Y-J;A(J)
 6675 IF Z$="0" THEN LPRINT K$;"AMOUNT INVESTED $";A(P)+(A(Q)*B)
 6680 INPUT Y$
 6690 GOTO U
 7000 IF Z$="5" THEN GOTO 7030
 7005 CLS 
 7010 PRINT K$;E$;"AMOUNT YOU WISH TO  START WITH?",,X$
 7015 INPUT C
 7020 IF C<=I THEN GOTO U
 7025 LET A(J)=C
 7030 IF Z$="4" THEN GOTO 7070
 7035 CLS 
 7040 PRINT C$;E$;B$(K);" RATE?",,,"ENTER IN DECIMAL FIGURE ONLY."
 7045 PRINT C$;"MUST BE LESS THAN 1","EXAMPLE 5 3/4 '/. = .0575",X$
 7050 INPUT C
 7055 IF C<=I THEN GOTO U
 7060 IF C>=J THEN GOTO 7035
 7065 LET A(K)=C
 7075 CLS 
 7080 PRINT C$;E$;"NUMBER OF TIMES PER YEAR THE INTEREST IS COMPOUNDED?";X$
 7085 INPUT C
 7090 IF C<=I THEN GOTO U
 7095 LET A(L)=C
 7096 IF Z$="6" THEN GOTO 7125
 7100 CLS 
 7105 PRINT C$;E$;"NUMBER OF YEARS YOU WISH TO CALCULATE?",X$
 7110 INPUT C
 7115 IF C<=I THEN GOTO U
 7120 LET A(O)=C
 7125 IF Z$="3" OR Z$="5" THEN GOTO 7155
 7130 CLS 
 7135 PRINT C$;E$;"AMOUNT YOU WISH TO  REACH?",,X$
 7140 INPUT C
 7145 IF C<=I THEN GOTO U
 7150 LET A(P)=C
 7155 IF Z$<>"5" THEN GOTO 7185
 7160 CLS 
 7165 PRINT K$;E$;"AMOUNT YOU WISH TO  DEPOSIT EACH COMPOUNDING PERIOD?";X$
 7170 INPUT C
 7175 IF C<=I THEN GOTO U
 7180 LET A(Q)=C
 7185 IF Z$="3" THEN LET A(S)=INT (V+(A(J)*(J+A(K)/A(L))**(A(L)*A(O)))*T)/T
 7190 IF Z$="4" THEN LET A(S)=INT (V+(((A(P)/A(J))**(J/(A(L)*A(O)))-J)*A(L))*T)/T
 7195 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
 7201 IF Z$="6" THEN LET BB=LN (A(P)/A(J))
 7202 IF Z$="6" THEN LET BC=LN (J+A(K)/A(L))*A(L)
 7203 IF Z$="6" THEN LET A(S)=INT ((V+(BB/BC)*T))/T
 7205 CLS 
 7206 PRINT C$
 7210 IF Z$="5" THEN GOTO 7220
 7215 PRINT "STARTING AMOUNT";TAB Y;"$";A(J)
 7220 IF Z$="4" THEN GOTO 7230
 7225 PRINT "INTEREST RATE";TAB Y;A(K)*T;" '/. "
 7230 IF Z$="6" THEN GOTO 7245
 7235 PRINT "NUMBER OF YEARS";TAB Y;A(O)
 7240 IF Z$<>"4" THEN GOTO 7250
 7245 PRINT "GOAL TO REACH";TAB Y;"$";A(P)
 7250 PRINT "COMPOUND PER YEAR";TAB Y;A(L)
 7255 IF Z$="3" THEN PRINT C$;"VALUE AT END","$";A(S)
 7260 IF Z$="4" THEN PRINT C$;"INTEREST REQUIRED",A(S)*T;" '/. "
 7265 IF Z$="5" THEN PRINT "DEPOSIT AMOUNT";TAB Y;"$";A(Q)
 7270 IF Z$="5" THEN PRINT "TOTAL DEPOSITS";TAB Y;"$";A(Q)*A(L)*A(O)
 7275 IF Z$="3" OR Z$="5" THEN PRINT C$;"MINIMUM VALUE","$";A(S)
 7280 IF Z$="6" THEN PRINT C$;"YEARS REQUIRED",A(S)
 7285 PRINT AT Y-K,I;C$;F$,I$,D$
 7290 INPUT Y$
 7295 IF Y$<>"££" THEN GOTO U
 7300 PRINT AT Y-J,I;K$;K$;K$
 7305 COPY 
 7310 GOTO U
 9000 REM 
 9010 LET H=10
 9011 LET I=H-H
 9012 LET J=H/H
 9020 LET K=J+J
 9030 LET L=K+J
 9040 LET O=L+J
 9050 LET P=O+J
 9060 LET Q=P+J
 9070 LET S=Q+J
 9080 LET T=H*H
 9090 LET U=H*O
 9100 LET V=J/K
 9110 LET W=H*L
 9120 LET Y=H*K
 9150 DIM B$(P,S+J)
 9160 LET B$(J)="AMOUNT"
 9170 LET B$(K)="INTEREST"
 9180 LET B$(L)="NUMBER"
 9190 LET B$(O)="PERIOD"
 9200 LET B$(P)="PAYMENT"
 9210 LET C$="''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''"
 9220 LET D$="% %I%N%P%U%T% %A%N%S%W%E%R% %P%L%E%A%S%E% "
 9230 LET E$="WHAT IS THE "
 9240 LET F$="££ = COPY THIS TO THE PRINTER "
 9250 LET G$="ANSWER £ TO EXIT "
 9260 LET H$="% %C%A%U%T%I%O%N%  INPUT NUMBERS ONLY"
 9270 LET I$="PRESS % %E%N%T%E%R%  TO CONTINUE"
 9280 DIM J$(H+K,H+K)
 9290 LET J$(J)="ANNUAL"
 9300 LET J$(O)="QUARTERLY"
 9310 LET J$(K)="SEMI ANNUAL"
 9330 LET J$(H+K)="MONTHLY"
 9340 LET K$="                                "
 9350 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$
 9360 LET M$=C$+"THIS WILL LET YOU PICK EXTRA    PAYMENT ON ANY PAYMENT NUMBER   YOU DESIRE"
 9370 LET N$=C$+"WHAT DO YOU WISH TO DO?         "+K$+"1 = VIEW SCHEDULE ON SCREEN ONLY0 = VIEW AND PRINT BOTH"
 9998 GOTO U+W
 9999 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 
 1000 CLS 
 1020 PRINT C$
 1030 PRINT TAB 5;"APPROXIMATE LOAN COST"
 1040 PRINT 
 1070 DIM A(S)
 1100 GOSUB U*H
 1130 GOTO U
 2000 CLS 
 2020 PRINT C$;TAB 8;"EXACT LOAN COST"
 2030 PRINT C$;"THIS PROCESS WILL TAKE TIME TO  CALCULATE SO DO NOT PRESS THE   BREAK KEY DURING THE CYCLE"
 2040 PRINT G$
 2050 PRINT I$,D$
 2060 INPUT Y$
 2070 IF Y$="£" THEN GOTO U
 2090 DIM A(S)
 2095 CLS 
 2100 GOSUB U*H
 2102 CLS 
 2105 REM 
 2110 LET A(S)=A(J)
 2120 LET R=A(K)/A(O)
 2125 LET A(Q)=I
 2130 FOR C=J TO A(L)
 2135 IF A(S)<=I THEN GOTO 2180
 2140 LET D=INT (V+A(S)*R*T)/T
 2145 LET A(L)=C
 2150 LET A(Q)=A(Q)+D
 2160 LET A(S)=INT (V+(A(S)-(A(P)-D))*T)/T
 2170 NEXT C
 2180 IF Z$="1" THEN GOTO 710
 2185 LET Z$="1"
 2190 GOSUB 760
 2195 GOTO U
 3000 CLS 
 3020 PRINT C$;TAB P;"AMORTIZATION SCHEDULE"
 3040 PRINT G$
 3050 PRINT I$,D$
 3060 INPUT Y$
 3070 IF Y$="£" THEN GOTO U
 3090 DIM A(S)
 3095 CLS 
 3100 GOSUB U*H
 3105 REM 
 3110 CLS 
 3120 PRINT N$
 3150 PRINT "5 = SEND TO PRINTER ONLY"
 3170 PRINT G$
 3180 INPUT X$
 3185 IF X$="1" OR X$="5" OR X$="0" THEN GOTO 3200
 3190 IF X$="£" THEN GOTO U
 3195 GOTO 3110
 3200 CLS 
 3205 IF Z$<>"4" THEN DIM G(A(L),K)
 3210 LET A(S)=A(J)
 3220 LET R=A(K)/A(O)
 3224 PRINT "NR, INTEREST PRICIPAL BALANCE"
 3226 PRINT "0";TAB L;"$";TAB H+K;"$";TAB Y+K;"$";A(J)
 3230 IF X$="5" OR X$="0" THEN LPRINT "NR. INTEREST PRINCIPAL BALANCE"
 3231 IF X$="5" OR X$="0" THEN LPRINT "0";TAB L;"$";TAB H+K;"$";TAB Y+K;"$";A(J)
 3232 LET E=O
 3235 LET A(Q)=I
 3238 FOR C=J TO A(L)
 3239 IF A(S)<=I THEN GOTO 3480
 3240 IF G(C,K)<>I THEN GOSUB 4500
 3245 LET D=INT (V+A(S)*R*T)/T
 3250 LET A(Q)=A(Q)+D
 3260 LET E=E+J
 3270 LET A(S)=INT (V+(A(S)-G(C,J)-(A(P)-D))*T)/T
 3280 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)
 3290 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)
 3300 IF X$="5" THEN GOTO 3340
 3310 IF E<=Y-K THEN GOTO 3470
 3320 PRINT C$;G$,I$,D$
 3330 INPUT Y$
 3335 IF Y$="£" THEN GOTO U
 3340 CLS 
 3350 LET E=J
 3470 NEXT C
 3490 PRINT K$;I$
 3500 INPUT Y$
 3510 CLS 
 3520 FAST 
 3525 IF Z$="4" THEN RETURN 
 3526 REM 
 3530 IF X$="5" OR X$="0" THEN GOSUB 950
 3540 GOSUB 900
 3550 PRINT I$,D$
 3560 INPUT Y$
 3570 GOTO U
 4000 CLS 
 4020 PRINT M$
 4030 PRINT L$
 4050 INPUT C
 4055 IF C<=I THEN GOTO U*T
 4060 DIM G(C,K)
 4065 REM 
 4070 CLS 
 4080 PRINT C$;"WHAT IS THE PAYMENT NUMBER YOU  WISH A ADD AN ADDITIONAL AMOUNT TO?",,"0 = COMPLETE GOTO PRINT SCHEDULE";H$,D$
 4090 INPUT E
 4100 IF Z$="5" AND E=0 THEN RETURN 
 4105 IF E>C THEN GOTO 4070
 4110 CLS 
 4114 IF E=I AND Z$="5" THEN RETURN 
 4115 IF E=I THEN GOTO 4160
 4120 PRINT C$;"WHAT IS THE AMOUNT OF ADDED     PAYMENT?",,H$,D$
 4130 INPUT B
 4140 LET G(E,J)=B
 4150 GOTO 4070
 4160 GOSUB W*T
 4170 GOTO 3526
 4500 REM 
 4510 LET M=M+J
 4520 LET A(K)=G(C,K)
 4530 LET A(L)=A(L)-C
 4540 LET R=A(K)/A(O)
 4550 LET D=INT (V+A(S)*(R/(J-(J+R)**(-A(L))))*T)/T
 4600 LET A(P)=D
 4610 LET B(M,J)=A(S)
 4620 LET B(M,K)=A(K)
 4630 LET B(M,L)=A(L)
 4640 LET B(M,O)=A(O)
 4650 LET B(M,P)=A(P)
 4660 LET B(M,Q)=A(Q)
 4670 LET B(M,S)=A(S)
 4680 LET B(M,S+J)=C
 4690 RETURN 
 5000 CLS 
 5020 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."
 5030 PRINT L$
 5040 INPUT C
 5050 IF C<=I THEN GOTO U
 5060 DIM G(C,K)
 5080 CLS 
 5090 PRINT K$;"WHAT IS THE TOTAL NUMBER OF     INTEREST RATES?",,K$;"INPUT 0 TO EXIT",,H$,D$
 5100 INPUT N
 5110 IF N<=I THEN GOTO U
 5130 FOR D=J TO N
 5140 CLS 
 5150 PRINT K$;TAB O;"INTEREST RATE NUMBER ";D
 5160 PRINT C$;E$;B$(K);" RATE?",,,"ENTER IN DECIMAL FIGURE ONLY."
 5170 PRINT C$;"MUST BE LESS THAN 1","EXAMPLE 10 3/4 '/. = .1075"
 5180 PRINT ,,H$,D$
 5190 INPUT F
 5200 IF F>=J THEN GOTO 5140
 5210 IF D=J THEN LET G(J,2)=F
 5220 IF D=J THEN NEXT D
 5230 PRINT C$;"AT WHAT PAYMENT NUMBER DOES THISRATE START?",,H$,D$
 5240 INPUT B
 5250 IF B<=I OR B>C THEN GOTO 5230
 5270 LET G(B,K)=F
 5280 NEXT D
 5290 CLS 
 5300 PRINT M$
 5310 PRINT K$;G$,I$,D$
 5320 INPUT Y$
 5330 IF Y$="£" THEN GOTO 5350
 5340 GOSUB 4065
 5350 CLS 
 5360 PRINT C$;E$;B$(J);"OF THE LOAN?",,H$,D$
 5370 INPUT D
 5380 CLS 
 5390 PRINT C$;E$;B$(P);B$(O)
 5400 PRINT "12=";J$(H+K)," 6=";J$(Q)," 4=";J$(O)," 1=";J$(J)
 5410 PRINT ,,H$,D$
 5420 INPUT F
 5430 CLS 
 5450 LET M=J
 5470 DIM A(S)
 5480 DIM B(N,S+J)
 5490 LET B(J,J)=D
 5500 LET B(J,K)=G(J,K)
 5510 LET B(J,L)=C
 5520 LET B(J,O)=F
 5530 LET B(J,S)=D
 5535 LET B(J,S+J)=J
 5540 LET R=B(J,K)/B(J,O)
 5550 LET C=INT (V+B(J,J)*(R/(J-(J+R)**(-B(J,L))))*T)/T
 5560 LET B(J,P)=C
 5570 FOR Z=J TO S
 5580 LET A(Z)=B(J,Z)
 5590 NEXT Z
 5600 LET G(J,K)=I
 5605 LET Z$="4"
 5610 GOSUB 3105
 5620 CLS 
 5630 FOR Z=J TO N-J
 5640 LET B(Z,Q)=B(Z+J,Q)-B(Z,Q)
 5650 NEXT Z
 5670 LET B(N,Q)=A(Q)-B(N,Q)
 5680 FOR Z=J TO N
 5685 CLS 
 5690 PRINT K$;TAB S+J;"RATE NUMBER ";Z
 5700 PRINT K$;B$(J),"$";B(Z,J)
 5710 PRINT B$(K);" RATE",B(Z,K)*T;" '/. "
 5720 PRINT B$(P);B$(L),B(Z,L)
 5730 PRINT B$(O),J$(B(Z,O))
 5740 PRINT B$(P),"$";B(Z,P)
 5750 PRINT "INT THIS RATE","$";B(Z,Q)
 5760 PRINT AT Y-K,I;C$;F$,I$,D$
 5766 IF Z=N THEN GOSUB 900
 5770 INPUT Y$
 5774 PRINT AT Y-J,I;K$;K$;K$
 5780 IF Y$="££" THEN COPY 
 5790 IF Y$="££" THEN GOTO 5810
 5800 IF X$="5" OR X$="0" THEN COPY 
 5810 NEXT Z
 5820 IF X$="5" OR X$="0" THEN GOSUB 950
 5830 GOTO U
 9000 REM 
 9010 LET H=10
 9011 LET I=H-H
 9012 LET J=H/H
 9020 LET K=J+J
 9030 LET L=K+J
 9040 LET O=L+J
 9050 LET P=O+J
 9060 LET Q=P+J
 9070 LET S=Q+J
 9080 LET T=H*H
 9090 LET U=H*O
 9100 LET V=J/K
 9110 LET W=H*L
 9120 LET Y=H*K
 9150 DIM B$(P,S+J)
 9160 LET B$(J)="AMOUNT"
 9170 LET B$(K)="INTEREST"
 9180 LET B$(L)="NUMBER"
 9190 LET B$(O)="PERIOD"
 9200 LET B$(P)="PAYMENT"
 9210 LET C$="''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''"
 9220 LET D$="% %I%N%P%U%T% %A%N%S%W%E%R% %P%L%E%A%S%E% "
 9230 LET E$="WHAT IS THE "
 9240 LET F$="££ = COPY THIS TO THE PRINTER "
 9250 LET G$="ANSWER £ TO EXIT "
 9260 LET H$="% %C%A%U%T%I%O%N%  INPUT NUMBERS ONLY"
 9270 LET I$="PRESS % %E%N%T%E%R%  TO CONTINUE"
 9280 DIM J$(H+K,H+K)
 9290 LET J$(J)="ANNUAL"
 9300 LET J$(O)="QUARTERLY"
 9310 LET J$(K)="SEMI ANNUAL"
 9330 LET J$(H+K)="MONTHLY"
 9340 LET K$="                                "
 9350 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$
 9360 LET M$=C$+"THIS WILL LET YOU PICK EXTRA    PAYMENT ON ANY PAYMENT NUMBER   YOU DESIRE"
 9370 LET N$=C$+"WHAT DO YOU WISH TO DO?         "+K$+"1 = VIEW SCHEDULE ON SCREEN ONLY0 = VIEW AND PRINT BOTH"
 9998 GOTO U+W
 9999 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.

Scroll to Top