This program calculates and displays a personal net worth statement by collecting values for current assets, other assets, and liabilities across three input screens. It organizes 27 financial categories — spanning cash, investments, real estate, personal property, and various debt types — read from DATA statements into three separate string and numeric arrays. Output is sent simultaneously to both the screen and a printer via paired PRINT/LPRINT statements throughout the display routine. Zero-value entries are suppressed from the summary screens using conditional GO TO jumps, keeping the report uncluttered. The program contains a few typographical errors in the DATA strings, including “REPLACEMANT” and “JEWLERY.”
Program Analysis
Program Structure
The program is divided into four logical phases: data initialization, data entry, asset display/printing, and liability display/printing with final net worth calculation. A subroutine at line 1000 handles screen clearing and header printing, called via GO SUB 1000 at several points to simulate pagination.
- Lines 100–380: REM headers and DATA statements defining 27 category labels.
- Lines 390–430: Array declarations and READ loops populating string arrays.
- Lines 450–660: Three sequential input screens for current assets, other assets, and liabilities.
- Lines 670–861: Asset summary — displays and prints non-zero entries with running totals.
- Lines 870–990: Liability summary, net worth calculation, and STOP.
- Lines 1000–1030: Screen/printer header subroutine.
Array Organization
| Array | Size | Purpose |
|---|---|---|
C$() | 12×32 | Current asset category labels (8 used) |
C() | 9 | Current asset values; C(9) accumulates total |
A$() | 12×32 | Other asset category labels (12 used) |
A() | 13 | Other asset values; A(13) accumulates total |
L$() | 7×32 | Liability category labels (7 used) |
L() | 8 | Liability values; L(8) accumulates total |
The last element of each numeric array serves as a running accumulator rather than using a separate variable. This is a common BASIC memory economy technique — the accumulator slots (C(9), A(13), L(8)) are never initialized explicitly, relying on the default zero value assigned to numeric array elements at declaration time.
Dual Screen/Printer Output
Every display statement in the summary section (lines 700–981) is immediately followed by a corresponding LPRINT statement, producing a hardcopy report in parallel with the screen output. This pairing is consistent but verbose, effectively doubling the line count of the output section. The subroutine at line 1000 also duplicates its CLS/PRINT pair with LPRINT, though the CLS on line 1011 is redundant since a second CLS after the first has no visible effect — only the printer header matters there.
Key BASIC Idioms
- Zero suppression: Lines
710,780, and920useIF value=0 THEN GO TOto skip printing categories the user left empty, keeping the report tidy. - Keypress gate: Line
870uses the busy-wait idiomLET X$=INKEY$: IF X$="" THEN GO TO 870to pause between the assets and liabilities screens, giving the user time to read the output. - TAB alignment:
TABis used extensively to align numeric output into columns, with values placed at positions 22 or 24 depending on the section. - Unused variable:
M$is set at line450to a format string resembling a currency template but is never referenced again. It appears to be a leftover from a different version of the program.
Bugs and Anomalies
- Typographical errors in DATA: Line
230contains “REPLACEMANT” (should be “REPLACEMENT”) and line260contains “JEWLERY” (should be “JEWELRY”). These will appear verbatim in all output. - Array over-declaration:
C$()is declared asDIM C$(12,32)but only 8 strings are read into it. SimilarlyA$()is declared with 12 rows, exactly matching its use, butC$()wastes 4 unused rows of 32 characters each. - Redundant CLS in subroutine: Line
1011issues anotherCLSimmediately after line1010already cleared the screen, which is harmless but unnecessary. - Missing PRINT on line 721: Line
721containsLPRINT ... : PRINT— the trailingPRINT(no arguments) after theLPRINTwill emit a blank line to the screen, which may not be intended at that point since the screen blank line is already output on line720. - Assets total display split: Lines
820–831print “TOTAL OTHER ASSETS” and thenTAB 22; A(13)on separate PRINT statements, which means the label and value appear on different lines on screen, unlike other totals that use a semicolon to keep them on one line.
Content
Source Code
100 REM PERSONAL NET WORTH(NETWORTH)
101 REM PRINTER VERSION (2040)
110 DATA "CASH ON HAND"
120 DATA "IN BANK ACCOUNTS "
130 DATA "IN IRA/KEOGH PLANS"
140 DATA "IN RETIREMENT PLANS"
150 DATA "CASH VALUE OF SAVINGS BONDS"
160 DATA "OF LIFE INSURANCE"
170 DATA "OF STOCKS"
180 DATA "OTHER CASH VALUE ASSETS"
190 DATA "OF REAL ESTATE"
200 DATA "OF CARS"
210 DATA "OF BOATS,PLANES,ETC."
220 DATA "OF BUSINESS EQUITY"
230 DATA "REPLACEMANT COST OF CLOTHING"
240 DATA "OF FURNITURE"
250 DATA "OF HOBBY EQUIPMENT"
260 DATA "OF JEWLERY AND FURS"
270 DATA "OF ART WORKS AND ANTIQUES"
280 DATA "OF TOOLS AND MACHINERY"
290 DATA "OF COLLECTIONS"
300 DATA "OTHER ASSETS OF VALUE"
310 DATA "SHORT TERM DEBTS DUE"
320 DATA "BALANCE ON MORTGAGE"
330 DATA "ON CAR LOANS"
340 DATA "ON PERSONAL LOANS"
350 DATA "ON RETAIL CREDIT"
360 DATA "ON OTHER LONG TERM DEBT"
370 DATA "OTHER LIABILITIES"
380 REM _________________
390 DIM C(9)
391 DIM C$(12,32)
392 DIM A(13)
393 DIM A$(12,32)
394 DIM L(8)
395 DIM L$(7,32)
410 FOR X=1 TO 8: READ C$(X): NEXT X
420 FOR X=1 TO 12: READ A$(X): NEXT X
430 FOR X=1 TO 7: READ L$(X): NEXT X
440 REM ----------------------
450 LET M$="\ \$$###,###"
460 LET T=30: GO SUB 1000
470 PRINT "CURRENT ASSETS:": PRINT ;
480 FOR X=1 TO 8
490 PRINT C$(X);TAB 32;
500 INPUT C(X)
520 NEXT X
530 GO SUB 1000: REM NEW SCREEN
540 PRINT "OTHER ASSETS:": PRINT
550 FOR X=1 TO 12
560 PRINT A$(X);TAB 32;
570 INPUT A(X)
590 NEXT X
600 GO SUB 1000: REM NEWSCREEN
610 PRINT "LIABILITIES:": PRINT
620 FOR X=1 TO 7
630 PRINT L$(X);TAB (32);
640 INPUT L(X)
660 NEXT X
670 REM ---------------------
680 GO SUB 1000: REM NEW SCREEN
690 PRINT "ASSETS:"
700 FOR X=1 TO 8
710 IF C(X)=0 THEN GO TO 730
720 PRINT C$(X);TAB (22);C(X): PRINT
721 LPRINT C$(X);TAB (22);C(X): PRINT
725 LET C(9)=C(9)+C(X)
730 NEXT X
740 PRINT TAB (20);"_________"
741 LPRINT TAB (20);"_________"
750 PRINT "TOTAL CURRENT ASSETS";TAB (22);
751 LPRINT "TOTAL CURRENT ASSETS";TAB (22);
760 PRINT C(9): PRINT
761 LPRINT C(9): LPRINT
770 FOR X=1 TO 12
780 IF A(X)=0 THEN GO TO 800
790 PRINT A$(X);TAB (24);A(X)
791 LPRINT A$(X);TAB (24);A(X)
792 LET A(13)=A(13)+A(X)
800 NEXT X
810 PRINT TAB (20);"_________"
811 LPRINT TAB (20);"_________"
820 PRINT "TOTAL OTHER ASSETS";TAB (22)
821 LPRINT "TOTAL OTHER ASSETS";TAB (22)
830 PRINT TAB 22;A(13)
831 LPRINT TAB 22;A(13)
840 PRINT TAB (17);"============="
841 LPRINT TAB (17);"============="
850 PRINT "TOTAL ASSETS";TAB (22);
851 LPRINT "TOTAL ASSETS";TAB (22);
860 PRINT C(9)+A(13)
861 LPRINT C(9)+A(13)
870 LET X$=INKEY$: IF X$="" THEN GO TO 870
880 REM -----------------------
890 GO SUB 1000: REM NEW SCREEN
900 PRINT "LIABILITIES:"
901 LPRINT "LIABILITIES:"
910 FOR X=1 TO 7
920 IF L(X)=0 THEN GO TO 940
929 LPRINT L$(X);TAB 24;L(X)
930 PRINT L$(X);TAB 24;L(X)
931 LET L(8)=L(8)+L(X)
940 NEXT X
941 PRINT TAB 18;"___________"
942 LPRINT TAB 18;"___________"
960 PRINT "TOTAL LIABILITIES ";L(8)
961 LPRINT "TOTAL LIABILITIES ";L(8)
970 LET X=A(13)+C(9)-L(8)
971 PRINT : PRINT TAB 18;"=============="
972 LPRINT : LPRINT TAB 18;"=============="
980 PRINT "NET WORTH";TAB 24;X
981 LPRINT "NET WORTH";TAB 24;X
990 STOP
1000 REM SCREEN ADVANCE SUBROUTINE
1010 CLS : PRINT "PERSONAL NET WORTH:"
1011 CLS : LPRINT "PERSONAL NET WORTH:"
1020 PRINT
1021 LPRINT
1030 RETURN
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
