Deposit Multiplier

This file is part of and Synchro-Sette June 1983. Download the collection to get this file.
Date: June 1983
Type: Program
Platform(s): TS 1000
Tags: Finance

This program calculates how many years it takes for a deposit to grow by a given multiplication factor at a specified annual interest rate. The user inputs an interest rate (as a percentage) and a target growth factor, and the program iterates year by year using compound interest via the exponentiation operator (`**`), counting periods until the accumulated amount exceeds the factor. After displaying the result, it pauses briefly and then reruns automatically. The program uses a simple iterative loop rather than the direct logarithmic formula, recalculating the full power `I**B` on each iteration rather than incrementally multiplying.


Program Analysis

Program Structure

The program is organized into three logical phases:

  1. Input phase (lines 10–45): Prompts the user for an annual interest rate and a growth factor, echoing each entry with a PRINT statement after input.
  2. Computation loop (lines 50–130): Converts the interest rate to a multiplier, then iterates year-by-year counting until the compounded amount exceeds the target factor.
  3. Output and restart (lines 200–240, 9999): Displays results, pauses, clears the screen, and reruns automatically.

Algorithm

Line 50 transforms the percentage rate I into a compound interest multiplier: I = 1 + (I / 100). The loop then evaluates A = I ** B at each year B, incrementing B until A exceeds the target factor F. This is a brute-force approach — rather than computing B = LOG(F) / LOG(I) directly, it recalculates the full power from scratch on every iteration. For typical interest rates and modest growth factors the loop terminates quickly, so performance is not a practical issue.

Key BASIC Idioms

  • PRINT ,, and PRINT ,,,, — use comma-separated print positions to indent output across tab stops, a common layout technique.
  • Echo printing after INPUT (lines 25 and 45) — restates the user’s entry, useful on systems where the input value may scroll or be unclear.
  • PAUSE 40000 — a long pause (approximately 11 minutes on a 50 Hz machine) effectively waits for user acknowledgement before continuing; combined with the subsequent RUN, it acts as a soft “press any key to restart.”
  • RUN at line 240 (and line 9999) restarts the program completely, clearing all variables, creating a continuous-use kiosk loop.

Notable Techniques and Anomalies

  • The exponentiation operator ** is used rather than ^, indicating this is an early or non-Spectrum BASIC dialect.
  • Variables A and B are explicitly initialised to zero at lines 60–70, which is redundant after a fresh RUN but would matter if execution ever reached line 60 without a full restart — defensive practice.
  • Line 9998 is a SAVE command with the filename DEPOSIT MULTIPLIE%R, where %R represents an inverse-video letter R, serving as an auto-run flag embedded in the filename.
  • Line 9999 contains a second RUN, which ensures that if the program is loaded without auto-run it still starts immediately.
  • The output at line 200 prints A, the first value of A that exceeds F, meaning it reports the compounded amount one year after the target is first surpassed rather than the threshold crossing year itself — a minor off-by-one in the display of A, though B correctly reflects the number of years elapsed.

Variable Summary

VariableRole
IInput interest rate (%), later overwritten with the multiplier 1 + I/100
FTarget growth factor supplied by the user
BYear counter (loop variable)
AComputed compounded amount I ** B at each iteration

Content

Appears On

Cassette to accompany the June 1983 issue of Synchro-Sette.

Related Products

Related Articles

Related Content

Image Gallery

Deposit Multiplier

Source Code

  10 PRINT ,,"WHAT IS THE INTEREST RATE PER   YEAR?  ";
  20 INPUT I
  25 PRINT I
  30 PRINT "WHAT IS THE INCREASE FACTOR?  ";
  40 INPUT F
  45 PRINT F
  50 LET I=1+(I/100)
  60 LET A=0
  70 LET B=0
 100 LET A=I**B
 110 IF A>F THEN GOTO 200
 120 LET B=B+1
 130 GOTO 100
 200 PRINT ,,,,"THE AMOUNT WOULD BE ";A
 210 PRINT "ITS SIZE IN ";B;" YEARS"
 220 PAUSE 40000
 230 CLS 
 240 RUN 
 9998 SAVE "DEPOSIT MULTIPLIE%R"
 9999 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top