--- title: "The Qualifier" id: 63125 type: "computer_media" slug: "the-qualifier" url: "http://localhost/computer_media/the-qualifier/" markdown_url: "http://localhost/computer_media/the-qualifier.md" published_at: "2026-01-26T12:18:52+00:00" modified_at: "2026-03-30T21:45:59+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/01/the-qualifier.png" excerpt: "Enter your down payment, monthly budget, interest rate, and loan term to instantly calculate the maximum home price you can afford." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Byte Power" slug: "byte-power" taxonomy: "post_tag" url: "http://localhost/tag/byte-power/" - 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: "Kristian Boisvert" slug: "boisvert-kristian" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-kristian/" genre: - name: "Home" slug: "home" taxonomy: "genre" url: "http://localhost/type/home/" media_contents: - id: 63049 title: "Byte Power Spring 1987" type: "computer_media" url: "http://localhost/computer_media/byte-power-spring-1987/" media_type: "Program" programmers: - name: "Kristian Boisvert" slug: "boisvert-kristian" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-kristian/" mediadate: "1987" producer_company: - id: 25181 title: "Byte Power" type: "company" url: "http://localhost/company/byte-power/" images: - url: "http://localhost/wp-content/uploads/2026/01/the-qualifier.png" article_media: - id: 63070 title: "The Qualifier" type: "article" url: "http://localhost/article/the-qualifier/" media_type_tags: "Home" --- # The Qualifier This program calculates the maximum home purchase price a buyer can afford based on their down payment, maximum monthly payment, interest rate, and loan term. It uses the standard mortgage present-value formula: the loan amount is derived from the monthly payment divided by the monthly interest factor, rounded down to the nearest $100. The result is displayed alongside a decorative double-rectangle border drawn with PLOT and DRAW commands. Input validation is applied to all fields, rejecting negative values, out-of-range interest rates, and loan terms outside 1–30 years. *** ## Program Structure The program is organized into three logical phases: 1. **Initialization / title display** — `GO SUB 2000` at line 20 draws a decorative border and title before input begins. 2. **Input collection** — Lines 30–98 gather four values: down payment, maximum monthly payment, annual interest rate, and loan term in years, each with inline validation loops. 3. **Calculation and output** — Lines 100–240 compute the affordable home price and display a formatted summary; `STOP` at line 1999 halts execution. The subroutine at lines 2000–2010 draws two concentric rectangles using `PLOT`/`DRAW` and prints a centred title, acting as a reusable banner called both at startup and after the `CLS` at line 150. ## Mortgage Calculation The core financial logic implements the present-value annuity formula for a fixed-rate mortgage: - `f1 = 1 - (1 + rate/12)^-(12*ye)` — the annuity numerator. - `f2 = f1 / (rate/12)` — the full present-value factor. - `lamount = month * f2` — maximum loan principal, then truncated to the nearest $100 via `INT (lamount/100)*100`. - `price = lamount + down` — total affordable purchase price, rounded to the nearest dollar using `INT ((price+.5)*100/100)`. Rounding `lamount` down (floor) to $100 keeps the monthly payment safely within budget; rounding `price` to the nearest dollar is cosmetic. ## Input Validation | Variable | Condition to retry | Line | | --- | --- | --- | | `down` | `down < 0` | 40 | | `month` | `month < 0` | 70 | | `rate` | `rate < .001 OR rate > 100` | 90 | | `ye` | `INT ye < 1 OR INT ye > 30` | 96–97 | Note that a down payment or monthly payment of exactly zero is accepted (only negative values are rejected), allowing the program to handle edge cases such as zero-down or interest-only scenarios. ## Notable BASIC Idioms - **Boolean string concatenation** — Line 220 uses `("s" AND ye>1)` to pluralise “year” without a conditional branch, a common Sinclair BASIC idiom where a true condition evaluates to 1 and false to 0 (empty string). - **INVERSE 1 highlight** — Line 155 prints the calculated price in inverse video for visual emphasis before reverting implicitly. - **Echoing input** — After each `INPUT`, the accepted value is printed at a fixed screen position (lines 41, 71, 91, 98) to provide a clean summary layout rather than relying on the INPUT prompt remnants. ## Source Code ``` 0 1 REM QUALIFIER (HOMES) 2 REM RESET 1987 BYTE POWER 3 REM BY K. BOISVERT 4 20 GO SUB 2000 30 PRINT AT 5,0;"Maximum down payment:"; 40 INPUT "Max:";down: IF down<0 THEN GO TO 40 41 PRINT "$";down 60 PRINT AT 7,0;"Max. monthly payment:"; 70 INPUT "Max:";month: IF month<0 THEN GO TO 70 71 PRINT "$";month 80 PRINT AT 9,0;"Interest rate:"; 90 INPUT "Interest:";rate: IF rate<.001 OR rate>100 THEN GO TO 90 91 PRINT rate;"%" 95 LET rate=rate/100: PRINT AT 11,0;"In how many years (30 max):"; 96 INPUT "Year(s):";ye 97 LET ye=INT ye: IF ye<1 OR ye>30 THEN GO TO 96 98 PRINT ye 100 LET f1=(1-((1+(rate/12))^-(12*ye))) 110 LET f2=f1/(rate/12) 120 LET lamount=month*f2: LET lamount=INT (lamount/100)*100 140 LET price=lamount+down: LET price=INT ((price+.5)*100/100) 150 CLS : GO SUB 2000: PRINT AT 5,0;"You can afford homes that are selling for:"; 155 PRINT INVERSE 1;"$";price 160 PRINT '"Mortgage of $";lamount 190 PRINT '"Down payment of $";down 200 PRINT '"Monthly payments of $";month 220 PRINT '"For a period of ";ye;" year"+("s" AND ye>1) 230 PRINT '"At an interest of ";rate*100;"%" 240 PRINT AT 20,0;"'RUN' TO GO BACK TO PROGRAM" 1999 STOP 2000 PLOT 65,156: DRAW 116,0: DRAW 0,14: DRAW -116,0: DRAW 0,-14 2001 PLOT 68,158: DRAW 110,0: DRAW 0,10: DRAW -110,0: DRAW 0,-10: PRINT AT 1,9;"The Qualifier" 2010 RETURN 9999 SAVE "QUALIFIER" LINE 1 ```