--- title: "Deposit Multiplier" id: 57607 type: "computer_media" slug: "deposit-multiplier" url: "http://localhost/computer_media/deposit-multiplier/" markdown_url: "http://localhost/computer_media/deposit-multiplier.md" published_at: "2024-10-06T00:23:29+00:00" modified_at: "2026-04-03T07:58:16+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2024/10/deposit-multiplier.png" excerpt: "Enter an interest rate and a target growth factor to find out exactly how many years your deposit takes to multiply — using a brute-force compound interest loop." 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 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" genre: - name: "Finance" slug: "finance" taxonomy: "genre" url: "http://localhost/type/finance/" media_contents: - id: 56724 title: "Synchro-Sette June 1983" type: "computer_media" url: "http://localhost/computer_media/synchro-sette-june-1983/" media_type: "Program" mediadate: "June 1983" images: - url: "http://localhost/wp-content/uploads/2024/10/deposit-multiplier.png" media_type_tags: "Finance" --- # Deposit Multiplier 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 | Variable | Role | | --- | --- | | `I` | Input interest rate (%), later overwritten with the multiplier `1 + I/100` | | `F` | Target growth factor supplied by the user | | `B` | Year counter (loop variable) | | `A` | Computed compounded amount `I ** B` at each iteration | ## 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 ```