Real Estate Investment Analysis is a two-mode financial modeling program that calculates after-tax cash flows and Internal Rate of Return (IRR) for either a rent-versus-buy comparison or an income-producing investment property. The program accepts up to 27 input variables stored in array M(), covering purchase price, down payment, mortgage term, depreciation, vacancy rates, inflation, and capital gains tax treatment. Mortgage payment calculations use the standard annuity formula with compound interest, while IRR is solved iteratively via a bisection-like convergence loop. A built-in line-drawing routine at line 5000 plots IRR against appreciation rate across a range of scenarios, rendering a graph using PLOT commands with linear interpolation between data points.
Program Analysis
Program Structure
The program is organized into a main flow with several clearly delineated functional blocks, plus subroutines for mortgage calculation, interest accumulation, line drawing, and the splash screen. Execution begins at line 5 and proceeds through mode selection, data entry, and an option menu loop anchored at line 860.
| Line Range | Function |
|---|---|
| 5–17 | Initialization: arrays, splash screen GOSUB |
| 32–70 | Mode selection (rent-vs-buy or investment) |
| 80–860 | Data entry for all input variables into M() |
| 860–966 | Main option menu (list data, cash flows, chart, IRR, change variable, stop) |
| 970–2450 | Computation engine: cash flows, IRR iteration, graph plotting |
| 2600–2920 | Input data listing (option 1) |
| 2980–2990 | Stop/exit |
| 4000–4450 | Variable change handler, re-entry into data entry loop |
| 5000–5140 | Line-drawing subroutine (PLOT-based) |
| 6000–6060 | Splash screen display |
| 7000–7010 | SAVE and RUN |
Input Data Storage
All financial inputs are stored in the single array M(27), with indices used as named slots. This avoids the need for many individual variables and makes the change-a-variable feature (option 5) straightforward to implement by re-entering specific array elements.
| Index | Meaning |
|---|---|
M(1) | Property price |
M(2) | Down payment percent |
M(3) | Interest rate |
M(4) | Vacancy rate percent (investment mode only) |
M(5) | Mortgage term in years |
M(6) | Land value (investment mode only) |
M(7) | Monthly rental income or alternative rent cost |
M(8)–M(12) | Annual operating expenses (utilities, taxes, maintenance, insurance, other) |
M(13) | Depreciation rate percent/year |
M(14) | Marginal income tax bracket |
M(15) | Inflation factor |
M(16) | Annual appreciation rate |
M(17)–M(18) | Tax-deductible and non-deductible closing costs |
M(19) | Years from purchase to sale |
M(20) | Mode flag (1=investment, 2=rent-vs-buy) |
M(21)–M(25) | Computed working values (loan amount, depreciable basis, etc.) |
M(26) | Capital gains deferral flag |
Mortgage and Cash Flow Calculations
The mortgage payment is computed at lines 1510–1600 using the standard present-value annuity formula. The monthly payment P is derived from the loan amount V1 = M(21), monthly rate J = M(3)/1200, and total periods N = M(5)*12, using the expression P = -V1 / ((1 - (1+J)^-N) / J). The result is stored as an annual figure in M(23) (i.e., -12*P).
Annual interest expense O2 is accumulated month-by-month in subroutine lines 1610–1660, iterating over the 12 months of each year and tracking the running loan balance in S3. This correctly handles the declining-balance nature of amortization rather than using an approximation.
Expenses and income are inflated each year by multiplying by the running inflation index I6, which grows by 1 + M(15)/100 per year. Depreciation is handled by the declining-balance method: each year’s depreciation O3 = M(24) * M(13)/100 is subtracted from the depreciable basis M(24) at line 1310.
IRR Computation
The Internal Rate of Return is solved iteratively using a bisection-style search (lines 1930–2090). The algorithm starts with J=0 and a step K2=0.2, evaluates the Net Present Value of the cash flow array C(), and halves the step size each time the sign of NPV changes. Convergence is tested at line 2080 with ABS(J - J1) <= 0.001, giving accuracy to roughly 0.1 percentage point. The cash flows are stored in C(1) (initial outlay, negative) through C(M(19)+1) (final year including sale proceeds).
The final year cash flow at line 1740 adds net sale proceeds: G1 * 0.94 represents the sale price less an assumed 6% real-estate commission. Capital gains tax is computed differently between modes: investment mode (line 1712) includes recaptured depreciation tax on the difference between original and remaining depreciable basis, while rent-vs-buy mode (line 1730) uses the capital gains deferral flag M(26).
Chart of Return Rate vs. Appreciation Rate
Option 3 triggers a loop (lines 2170–2184) that sweeps M(16) (appreciation rate) from 0 upward, recomputing IRR at each step and storing data point pairs in arrays D() and E(). Steps of 2 percent are used while IRR is negative (line 2174), switching to steps of 10 once positive (line 2182), up to a maximum of 25 percent. The original appreciation rate is saved in A1 at line 974 and restored at line 2405 after the chart is drawn.
The graph is rendered using PLOT and the line-drawing subroutine at line 5000. Axis scaling is computed at lines 2254–2255 using SX = 48 / D(H-1) and SY = 30 / E(H-1) to fit the data within the display area. Y-axis labels are printed vertically character by character (lines 2329–2375). The line-drawing subroutine at lines 5000–5140 handles both steep (near-vertical) and shallow lines by switching between x-driven and y-driven iteration at line 5005, based on whether C - A <= 0.
Variable Change Mechanism
The variable change feature uses a re-entry approach controlled by the flag Q$. When a variable is to be changed, Q$ is set to "Y" at line 4045, and execution jumps into the data-entry section at the appropriate line. After each INPUT statement, a test such as IF Q$="Y" THEN GOTO 4000 immediately returns to the change menu rather than proceeding to the next question. This avoids duplicating the input prompts and allows single-variable edits cleanly.
Key BASIC Idioms and Techniques
- FAST/SLOW mode is toggled around computation-heavy sections to speed up numeric work while keeping readable output display.
INT(X + 0.5)is used throughout for rounding displayed dollar values to the nearest integer.- The INKEY$ polling loop at lines 941–950 reads the menu choice: it first waits for a key release (
INKEY$<>""test at 941), then reads the key, assigningF1based on the character. A key greater than"6"setsF1=7, which then fails the validity check at line 960. - Array
C(30)holds the after-tax cash flow series, dimensioned to accommodate up to 29 years plus the initial outlay at index 1.
Bugs and Anomalies
- Line 758 (
IF Q$="Y" THEN GOTO 4000) is unreachable: it follows aGOTO 730at line 756 and can never be executed. - Lines 1074 (
PRINT AT 20,0;"CASH FLOW...") and 1140/1330/2090 (bareREM) are unreachable dead code; the flow jumps from line 1030 directly to line 1080 or 1080 for options 3 and 4, bypassing line 1074. - At line 950,
IF INKEY$>"6" THEN LET F1=7could match letters and other high-ASCII characters, but the subsequent validity check at line 960 correctly rejectsF1=7. - The variable
Dis used both as an array (D(24)) and as a plain numeric variable in the line-drawing subroutine (line 2224:LET D=13). On most implementations this would cause a conflict or error; the arrayD()stores appreciation-rate data points while the scalarDis a subroutine parameter — these share the same name and will collide. - Similarly,
Cis both an array (C(30)holding cash flows) and a scalar variable used as a subroutine parameter in the line-drawing calls (e.g., line 2220:LET C=62), creating the same name collision. - The inflation multiplier
I6is applied cumulatively but is multiplied after computing the current year’s income at line 1200, so year 1 uses the base value and year 2 onward gets the inflated value — this is the correct intended behavior.
Content
Source Code
5 LET Q$="N"
10 DIM M(27)
12 DIM D(24)
14 DIM E(24)
15 DIM C(30)
16 GOSUB 6000
17 CLS
32 PRINT AT 5,1;"SELECT REAL ESTATE ANALYSIS PROGRAM MODE"
40 PRINT AT 9,3;"1 = FOR RENT VS. BUY"
42 PRINT AT 11,3;"2 = FOR INVESTMENT"
50 IF INKEY$="1" THEN GOTO 60
53 IF INKEY$="2" THEN GOTO 70
54 GOTO 50
60 LET X1=0
65 GOTO 80
70 LET X1=1
80 CLS
90 IF X1<>1 THEN GOTO 150
95 LET H=1
145 GOTO 190
150 LET H=1
190 CLS
300 PRINT ". NUM. OF YRS FROM PURCHASE UNTIL SALE (2-5 YRS SUGGESTED)=?";
310 INPUT M(19)
311 PRINT M(19)
312 IF Q$="Y" THEN GOTO 4000
320 IF X1=1 THEN GOTO 340
322 PRINT ". DO YOU EXPECT TO DEFER INCOME TAXES ON CAPITAL GAINS WHEN YOU"
323 PRINT "SELL, BY INVERTING? (Y/N) ";
330 INPUT T$
332 PRINT T$
334 IF T$="Y" THEN GOTO 338
336 LET M(26)=1
337 GOTO 340
338 LET M(26)=0
340 PRINT ". PRICE OF THE PROPERTY=? ";
350 INPUT M(1)
352 PRINT M(1)
355 IF Q$="Y" THEN GOTO 4000
360 PRINT ". PERCENT DOWNPAYMENT=? ";
370 INPUT M(2)
371 PRINT M(2)
375 IF Q$="Y" THEN GOTO 4000
380 PRINT ". INTEREST RATE=? ";
390 INPUT M(3)
391 PRINT M(3)
395 IF Q$="Y" THEN GOTO 4000
400 PRINT ". TAX DEDUCTABLE CLOSING COSTS($)=? ";
410 INPUT M(17)
411 PRINT M(17)
415 IF Q$="Y" THEN GOTO 4000
420 PRINT ". NON-DEDUCTABLE CLOSING COSTS OR OTHER INITIAL COSTS($)=? ";
430 INPUT M(18)
431 PRINT M(18)
435 IF Q$="Y" THEN GOTO 4000
440 PRINT ". MORTGAGE TERM IN YRS=? ";
450 INPUT M(5)
451 PRINT M(5)
455 IF Q$="Y" THEN GOTO 4000
460 IF X1=1 THEN GOTO 468
462 GOTO 490
468 PRINT ". VALUE OF THE LAND=? ";
470 INPUT M(6)
471 PRINT M(6)
475 IF Q$="Y" THEN GOTO 4000
480 PRINT ". MONTHLY RENTAL INCOME (ALL UNITS OCCUPIED)=? ";
481 GOTO 500
490 PRINT ". MONTHLY ALTERNATIVE RENT COST FOR EQUIVALENT HOUSING, PLUS MO. UTILITIES YOU PAY=? ";
500 INPUT M(7)
501 PRINT M(7)
505 IF Q$="Y" THEN GOTO 4000
510 IF X1=1 THEN GOTO 514
512 GOTO 530
514 PRINT ". PERCENT ESTIMATED VACANCY RATE=? ";
520 INPUT M(4)
521 PRINT M(4)
525 IF Q$="Y" THEN GOTO 4000
530 PRINT ". ANNUAL UTILITIES EXPENSE=? ";
540 INPUT M(8)
541 PRINT M(8)
545 IF Q$="Y" THEN GOTO 4000
550 PRINT ". ANNUAL PROPERTY TAXES=? ";
560 INPUT M(9)
561 PRINT M(9)
565 IF Q$="Y" THEN GOTO 4000
570 IF X1=1 THEN GOTO 574
572 GOTO 590
574 PRINT ". MAINTENENCE AS PERCENT OF RENTAL INCOME? (25-30 SUGGESTED)= ";
580 GOTO 600
590 PRINT ". ANNUAL MAINTENANCE COSTS=? ";
600 INPUT M(10)
601 PRINT M(10)
605 IF Q$="Y" THEN GOTO 4000
610 PRINT ". ANNUAL INS. COSTS=? ";
620 INPUT M(11)
621 PRINT M(11)
625 IF Q$="Y" THEN GOTO 4000
630 PRINT ". OTHER ANNUAL EXPENSES=? ";
640 INPUT M(12)
641 PRINT M(12)
642 CLS
645 IF Q$="Y" THEN GOTO 4000
650 IF X1=1 THEN GOTO 670
655 LET M(13)=0
660 GOTO 690
670 PRINT ". DEPRECIATION RATE PERCENT/YR (USES DECLINING BALANCE METHOD)=? ";
680 INPUT M(13)
681 PRINT M(13)
685 IF Q$="Y" THEN GOTO 4000
690 PRINT ". MARGINAL INCOME TAX BRACKET=? ";
700 INPUT M(14)
701 PRINT M(14)
705 IF Q$="Y" THEN GOTO 4000
710 PRINT ". INFLATION FACTOR FOR RENTS, EX-PENSES, AND PROPERTY TAXES=? ";
715 IF Q$="Y" THEN GOTO 4000
720 INPUT M(15)
721 PRINT M(15)
730 PRINT ". ASSUMED APPRECIATION RATE (PERCENT PER YEAR)=? ";
740 INPUT M(16)
741 PRINT M(16)
750 IF M(16)>=0 THEN GOTO 760
754 PRINT "MUST NOT BE LESS THAN ZERO"
756 GOTO 730
758 IF Q$="Y" THEN GOTO 4000
760 IF X1=1 THEN GOTO 766
762 LET M(20)=2
764 GOTO 860
766 LET M(20)=1
768 IF Q$="Y" THEN GOTO 4000
860 LET FLA=0
865 CLS
867 SLOW
870 PRINT AT 3,2;"SELECT OPTION:"
880 PRINT AT 5,5;"1 = LIST INPUT DATA"
890 PRINT AT 7,5;"2 = A.T.CASH FLOWS AND IRR"
900 PRINT AT 9,5;"3 = CHART OF RATE OR RETURN (PER YEAR) VS. ANNUAL"
910 PRINT AT 11,9;"APPRECIATION RATE"
920 PRINT AT 13,5;"4 = COMPUTE IRR ONLY"
930 PRINT AT 15,5;"5 = CHANGE A VARIABLE"
940 PRINT AT 17,5;"6 = STOP"
941 IF INKEY$<>"" THEN GOTO 944
942 GOTO 941
944 IF INKEY$="1" THEN LET F1=1
945 IF INKEY$="2" THEN LET F1=2
946 IF INKEY$="3" THEN LET F1=3
947 IF INKEY$="4" THEN LET F1=4
948 IF INKEY$="5" THEN LET F1=5
949 IF INKEY$="6" THEN LET F1=6
950 IF INKEY$>"6" THEN LET F1=7
960 IF INT (F1)<>F1 OR INT (F1)<1 OR INT (F1)>6 THEN GOTO 964
962 GOTO 970
964 PRINT "NO GOOD, TRY AGAIN"
966 GOTO 941
970 IF F1<>3 THEN GOTO 980
971 CLS
972 PRINT AT 21,0;"COMPUTING RETURN RATE (IRR)..."
973 FAST
974 LET A1=M(16)
975 LET M(16)=0
976 LET H=1
980 LET I6=1
990 LET O3=0
1000 LET Y2=0
1010 IF F1=1 THEN GOTO 2600
1020 IF F1=2 THEN GOTO 1070
1030 IF F1=3 OR F1=4 THEN GOTO 1080
1040 IF F1=5 THEN GOTO 4000
1050 IF F1=6 THEN GOTO 2980
1074 PRINT AT 20,0;"CASH FLOW AND INCOME COMPUTATION"
1080 FAST
1090 LET M(21)=M(1)-M(2)/100*M(1)
1100 IF X1=1 THEN LET M(22)=M(1)-M(6)
1110 IF X1=1 THEN GOTO 1116
1111 LET M(24)=0
1112 LET M(22)=0
1114 GOTO 1120
1116 LET M(24)=M(22)
1120 LET M(25)=M(21)
1130 GOSUB 1510
1140 REM
1150 FAST
1158 LET Y2=Y2+1
1160 LET P1=1+(Y2-1)*12
1170 LET P2=P1+11
1180 GOSUB 1610
1190 IF X1=1 THEN GOTO 1196
1192 LET O1=12*M(7)*I6
1194 GOTO 1200
1196 LET O1=12*M(7)*(100-M(4))/100*I6
1200 LET I6=I6*(1+M(15)/100)
1210 IF X1=1 THEN GOTO 1216
1212 LET O3=0
1214 GOTO 1220
1216 LET O3=M(24)*M(13)/100
1220 IF X1<>1 THEN GOTO 1240
1222 LET O4=(M(8)+M(9)+M(11)+M(12))*I6+O1*M(10)/100
1230 GOTO 1250
1240 LET O4=(M(8)+M(9)+M(10)+M(11)+M(12))*I6+M(23)-O2
1250 LET O5=O2+O3+O4
1255 IF X1<>1 THEN LET O5=O5-O3
1260 LET O6=O1-O5
1270 IF X1=1 THEN GOTO 1274
1271 LET P7=(O2+M(9))*(M(14)/100)
1272 GOTO 1280
1274 LET O7=O6*(-M(14)/100)
1280 IF X1=1 THEN GOTO 1284
1282 LET O8=O1-O2-O4
1283 GOTO 1290
1284 LET O8=O1-M(23)-O4
1290 IF X1=1 THEN GOTO 1296
1292 LET O9=O8+P7
1294 GOTO 1300
1296 LET O9=O8+O7
1300 LET C(Y2+1)=O9
1305 IF X1<>1 THEN GOTO 1320
1310 LET M(24)=M(24)-O3
1320 LET M(25)=M(25)-M(23)+O2
1324 CLS
1330 REM
1340 IF F1<>2 THEN GOTO 1490
1350 PRINT "****CASHFLOW AND INCOME ****"
1351 PRINT
1352 PRINT
1353 PRINT "YEAR ";Y2;TAB 22;"(ANNUAL $)"
1360 IF X1=1 THEN GOTO 1364
1361 GOTO 1380
1364 PRINT
1365 PRINT "GROSS RENTAL INCOME =";TAB 23;INT (O1+.5)
1370 GOTO 1390
1380 PRINT
1382 PRINT "ALTER. RENTAL COSTS =";TAB 23;INT (O1+.5)
1390 PRINT
1392 PRINT "EXPENSES:"
1400 PRINT "INTEREST EXPENSE =";TAB 23;INT (O2+.5)
1410 PRINT "DEPREC. EXPENSE =";TAB 23;INT (O3+.5)
1420 PRINT "OTHER EXPENSE =";TAB 23;INT (O4+.5)
1430 PRINT "TOTAL EXPENSES =";TAB 23;INT (O5+.5)
1440 PRINT
1450 PRINT "NET INCOME =";TAB 23;INT (O6+.5)
1460 PRINT "B.T. CASH FLOW =";TAB 23;INT (O8+.5)
1470 IF X1<>1 THEN PRINT "INCOME TAX SAVINGS =";TAB 23;INT (P7+.5)
1480 PRINT "A.T. CASH FLOW =";TAB 23;INT (O9+.5)
1481 SLOW
1482 PRINT AT 21,0;">PRESS ANY KEY TO CONTINUE<<"
1484 IF INKEY$<>"" THEN GOTO 1490
1486 GOTO 1484
1490 IF Y2>=M(19) THEN GOTO 1670
1505 GOTO 1150
1510 REM
1520 LET S3=M(21)
1530 LET V1=M(21)
1540 LET J=M(3)/1200
1550 LET N=M(5)*12
1560 LET R=(1+J)**(-N)
1570 LET P=-V1/((1-R)/J)
1580 LET P=INT (P*100+.5)/100
1590 LET M(23)=-12*P
1600 RETURN
1610 REM
1620 LET O2=0
1630 FOR I=P1 TO P2
1640 LET S2=J*S3
1641 LET S2=INT (S2*100+.5)/100
1644 LET S3=S3+S2+P
1645 LET O2=O2+S2
1650 NEXT I
1660 RETURN
1670 REM
1675 FAST
1680 LET C(1)=-M(1)*M(2)/100-M(18)-M(17)*(100-M(14))/100
1690 LET A2=C(M(19)+1)
1700 LET G1=M(1)*(1+M(16)/100)**M(19)
1710 IF X1<>1 THEN GOTO 1730
1712 LET T=(M(22)-M(24))*M(14)/100+(G1*.94-M(1))*.4*M(14)/100
1724 GOTO 1740
1730 LET T=M(26)*(G1*.94-M(1))*.4*M(14)/100
1740 LET C(M(19)+1)=A2+G1*.94-T-M(25)
1750 IF F1<>2 THEN GOTO 1920
1755 CLS
1760 IF X1=1 THEN PRINT AT 0,0;"SUMMARY OF AFTER TAX CASH FLOWS"
1770 PRINT AT 2,0;"SUMMARY OF MARGINAL A. T. CASH FLOWS"
1772 PRINT
1780 FOR I=1 TO M(19)+1
1790 PRINT "YEAR ";I-1;TAB 20;INT (C(I)+.5)
1800 NEXT I
1810 PRINT
1830 PRINT "FINAL SALE PRICE = ";INT (G1+.5)
1840 PRINT
1850 PRINT "WITH 6 PERCENT REAL ESTATE"
1852 PRINT "COMMISSION, SALE PROCEEDS IN"
1853 PRINT "YEAR ";M(19);" ARE ";
1860 PRINT INT (G1*.94+.5)
1880 PRINT
1920 REM
1922 FAST
1930 LET K1=1
1940 LET K2=.2
1950 LET J2=0
1960 LET J=0
1970 LET V2=0
1980 LET V4=0
1990 FOR I=1 TO M(19)+1
2000 LET R=(1+J)**(I-1)
2010 LET V1=C(I)/R
2020 LET V2=V2+V1
2030 NEXT I
2040 LET K=ABS (V2)/V2
2050 IF K=K1 THEN GOTO 2060
2052 LET K1=K
2054 LET K2=K2/2
2060 LET J1=J+K1*K2
2061 IF F1=2 THEN LET FLA=1
2062 IF F1=4 THEN GOTO 2080
2063 IF FLA=1 THEN GOTO 2070
2064 LET FLA=1
2066 PRINT " APPR. RATE (PER.) IRR (PER.)"
2068 PRINT " ----------------- ----------"
2069 PRINT
2070 IF J1>=0 THEN GOTO 2080
2072 PRINT TAB 7;M(16);TAB 22;"NEGATIVE"
2074 LET J=0
2076 LET J1=J
2078 LET J2=1
2079 GOTO 2100
2080 IF ABS (J-J1)<=.001 THEN GOTO 2090
2082 LET J=J1
2084 GOTO 1970
2090 REM
2092 IF F1<>3 THEN PRINT "AT ANN. APPREC. RATE ";M(16);" PERCENT ";" A. T. INT. OF RETURN = ";INT (J*10000)/100,"PERCENT"
2093 IF F1=3 THEN GOTO 2100
2094 SLOW
2095 PRINT AT 21,0;">>PRESS ANY KEY TO CONTINUE<<"
2096 IF INKEY$<>"" THEN GOTO 2100
2097 GOTO 2096
2100 IF F1<>3 THEN GOTO 860
2110 IF J=0 THEN GOTO 2170
2120 LET X=M(16)
2130 LET D(H)=X
2140 LET E(H)=J*100
2150 LET H=H+1
2160 PRINT TAB 7;M(16);TAB 22;E(H-1)
2170 IF J2=1 AND M(16)<24 THEN GOTO 2174
2172 GOTO 2180
2174 LET M(16)=M(16)+2
2176 GOTO 1700
2180 IF M(16)>=25 THEN GOTO 2190
2182 LET M(16)=M(16)+10
2184 GOTO 1700
2190 PRINT AT 21,0;">>PRESS ANY KEY TO CONTINUE<<"
2191 SLOW
2192 IF INKEY$<>"" THEN GOTO 2196
2194 GOTO 2192
2196 CLS
2198 FAST
2199 LET LL=0
2200 LET A=12
2210 LET B=13
2220 LET C=62
2224 LET D=13
2226 GOSUB 5000
2230 LET A=12
2235 LET B=14
2240 LET C=12
2245 LET D=43
2250 GOSUB 5000
2254 LET SX=48/D(H-1)
2255 LET SY=30/E(H-1)
2260 FOR I=1 TO 51 STEP 8
2270 PLOT I+11,12
2275 PRINT AT 16,I/2+5;LL
2276 LET LL=LL+5
2280 NEXT I
2290 FOR I=1 TO 31 STEP 5
2300 PLOT 11,I+12
2310 NEXT I
2312 LET AY=INT (E(H-1)/6+.5)
2313 LET MA=AY*6
2314 LET II=0
2315 FOR I=1 TO 3
2316 PRINT AT II,2;MA
2317 LET II=II+5
2318 LET MA=MA-AY*2
2319 NEXT I
2320 PRINT AT 19,8;"ANNUAL APPREC. RATE PER."
2329 PRINT AT 0,0;"I"
2330 PRINT AT 1,0;"N"
2335 PRINT AT 2,0;"T"
2337 PRINT AT 3,0;"."
2340 PRINT AT 5,0;"R"
2345 PRINT AT 6,0;"A"
2350 PRINT AT 7,0;"T"
2355 PRINT AT 8,0;"E"
2360 PRINT AT 10,0;"R"
2365 PRINT AT 11,0;"E"
2370 PRINT AT 12,0;"T"
2375 PRINT AT 13,0;"."
2380 FOR I=1 TO H-2
2390 PLOT INT (D(I)*SX+12),INT ((E(I)*SY)+13)
2391 LET A=INT (D(I)*SX+12)
2392 LET B=INT (E(I)*SY+13)
2393 LET C=INT (D(I+1)*SX+12)
2394 LET D=INT (E(I+1)*SY+13)
2395 GOSUB 5000
2400 NEXT I
2405 LET M(16)=A1
2406 SLOW
2410 PRINT AT 21,0;">>PRESS ANY KEY TO CONTINUE<<"
2420 IF INKEY$<>"" THEN GOTO 860
2450 GOTO 2410
2600 REM ****PRINT INPUT VARIABLES****
2610 PRINT
2620 CLS
2640 PRINT " ****INPUT DATA****"
2645 PRINT " ----------"
2646 PRINT
2660 PRINT "PROPERTY PRICE";TAB 26;M(1)
2665 PRINT
2670 PRINT "PERCENT DOWN";TAB 26;M(2)
2675 PRINT
2680 PRINT "INTEREST RATE PERCENT";TAB 26;M(3)
2685 PRINT
2690 PRINT "TAX-DED. CLOSING COSTS";TAB 26;M(17)
2695 PRINT
2700 PRINT "NON-DED. CLOSING COSTS";TAB 26;M(18)
2710 PRINT
2720 PRINT "MORTGAGE TERM YRS.";TAB 26;M(5)
2725 PRINT
2726 IF X1<>1 THEN GOTO 2750
2730 PRINT "LAND VALUE";TAB 26;M(6)
2735 PRINT
2740 PRINT "MONTHLY RENTAL INCOME";TAB 26;M(7)
2745 GOTO 2755
2750 PRINT "ALTER. MONTH RENTAL COSTS";TAB 26;M(7)
2755 PRINT
2760 IF X1=1 THEN PRINT "PER. EST. VACANCY RATE";TAB 26;M(4)
2762 PRINT AT 21,0;">>PRESS ANY KEY TO CONTINUE<<"
2764 IF INKEY$<>"" THEN GOTO 2770
2765 GOTO 2764
2770 CLS
2775 PRINT "ANNUAL UTILITIES EXP.";TAB 26;M(8)
2780 PRINT
2790 PRINT "ANNUAL PROPERTIES TAX";TAB 26;M(9)
2795 PRINT
2800 IF X1<>1 THEN GOTO 2820
2805 PRINT "RENTAL MAINT. PERCENT";TAB 26;M(10)
2810 GOTO 2830
2820 PRINT "ANNUAL MAINT. COSTS";TAB 26;M(10)
2830 PRINT
2835 PRINT "ANNUAL INSURANCE EXP.";TAB 26;M(11)
2836 PRINT
2840 PRINT "OTHER ANNUAL EXP.";TAB 26;M(12)
2845 PRINT
2850 IF X1=1 THEN PRINT "PERCENT YR. DEPRECIATION";TAB 26;M(13)
2860 PRINT
2870 PRINT "MAR. INCOME TAX PER.";TAB 26;M(14)
2875 PRINT
2880 PRINT "INFLATION RATE";TAB 26;M(15)
2885 PRINT
2890 PRINT "EST. PROP. APPR. PER./YR.";TAB 26;M(16)
2894 PRINT
2900 PRINT "YEARS: PURCHASE TO SALE";TAB 26;M(19)
2910 PRINT AT 21,0;">>PRESS ANY KEY TO CONTINUE<<"
2914 IF INKEY$<>"" THEN GOTO 860
2920 GOTO 2914
2980 CLS
2985 PRINT AT 11,10;"**DONE**"
2990 STOP
4000 CLS
4005 PRINT "DO YOU WANT TO CHANGE A VARIABLE? (Y/N)"
4010 IF INKEY$="N" THEN GOTO 860
4020 IF INKEY$="Y" THEN GOTO 4040
4030 GOTO 4010
4040 CLS
4045 LET Q$="Y"
4046 PRINT "WHICH OF THE FOLLOWING VARIABLES"
4050 PRINT AT 3,0;" 1==NUMBER OF YEARS"
4060 PRINT " 2==PRICE OF THE PROPERTY"
4070 PRINT " 3==PERCENT DOWNPAYMENT"
4080 PRINT " 4==PERCENT INTEREST RATE"
4090 PRINT " 5==TAX-DED. CLOSING COSTS"
4095 PRINT " 6==NON-DED. CLOSING COSTS"
4100 PRINT " 7==MORTGAGE TERM IN YEARS"
4120 IF X1=1 THEN PRINT " 8==VALUE OF THE LAND"
4125 IF X1=1 THEN PRINT " 9==MONTHLY RENTAL INCOME"
4130 IF X1=0 THEN PRINT " 9==ALTER. MONTHLY RENTAL COSTS"
4140 IF X1=1 THEN PRINT " 10==PERCENT EST. VACANCY RATE"
4150 PRINT " 11==ANNUAL UTILITIES EXP."
4160 PRINT " 12==ANNUAL PROPERTY TAX"
4170 IF X1=1 THEN PRINT " 13==MAINT. PER. RENTAL INCOME"
4180 IF X1=0 THEN PRINT " 14==ANNUAL MAINTENANCE COSTS"
4190 PRINT " 15==OTHER ANNUAL EXPENSES"
4200 IF X1=1 THEN PRINT " 16==PER./YR. DEPRECIATION"
4210 PRINT " 17==MARGINAL INCOME TAX PER."
4220 PRINT " 18==INFLATION FACTOR"
4230 PRINT " 19==ASSUMED APPR. RATE"
4235 PRINT AT 21,0;"ENTER YOUR CHOICE"
4240 INPUT F5
4245 CLS
4250 IF F5=1 THEN GOTO 300
4260 IF F5=2 THEN GOTO 340
4270 IF F5=3 THEN GOTO 360
4280 IF F5=4 THEN GOTO 380
4290 IF F5=5 THEN GOTO 400
4300 IF F5=6 THEN GOTO 420
4310 IF F5=7 THEN GOTO 440
4320 IF F5=8 THEN GOTO 468
4330 IF X1=1 AND F5=9 THEN GOTO 480
4335 IF X1=0 AND F5=9 THEN GOTO 490
4340 IF F5=10 THEN GOTO 514
4350 IF F5=11 THEN GOTO 530
4360 IF F5=12 THEN GOTO 550
4370 IF F5=13 THEN GOTO 574
4380 IF F5=14 THEN GOTO 590
4390 IF F5=15 THEN GOTO 630
4400 IF F5=16 THEN GOTO 650
4410 IF F5=17 THEN GOTO 690
4420 IF F5=18 THEN GOTO 710
4430 IF F5=19 THEN GOTO 730
4440 PRINT "INVALID CODE - TRY AGAIN"
4450 GOTO 4000
5000 REM
5005 IF C-A<=0 THEN GOTO 5100
5010 LET M=(D-B)/(C-A)
5020 LET S=B-M*A
5030 LET DX=A
5040 LET DY=INT (M*DX+S)
5050 PLOT DX,DY
5060 LET DX=DX+1
5070 IF DX<=C THEN GOTO 5040
5080 RETURN
5090 REM
5100 LET DY=B
5110 PLOT A,DY
5120 LET DY=DY+1
5130 IF DY<=D THEN GOTO 5110
5140 RETURN
6000 PRINT AT 7,5;"REAL ESTATE INVESTMENT"
6010 PRINT AT 14,1;"AMERICAN MICRO PRODUCTS, INC."
6020 PRINT AT 16,7;"RICHARDSON, TEXAS"
6030 PRINT AT 20,8;"COPYRIGHT, 1982"
6040 FOR I=1 TO 50
6050 NEXT I
6060 RETURN
7000 SAVE "PF%1"
7010 RUN
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

