Income Tax — 8K/16K

Author(s): Lane Lester
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v3 n3 (Volume 3, Issue 3)
Date: March 1982
Pages: 8-10

It’s that time of year again and I hope that TAX will reduce some of the nuisance of tax return preparation, if not the pain in the pocket. It is designed to aid in year-end form preparation and also to allow periodic monitoring of tax liability during the year. You may be able to reduce the amount withheld from your salary or the amount of your quarterly payments if self-employed. Personally, I’d rather have the money during the year than have the IRS hold it for me.

Lines 100-152 provide the main menu of functions with line 170 serving as an error trap for accidental entries. You can quickly see the program’s various capabilities. Tax calculation includes all arithmetic and transferring totals to appropriate lines.

The PAUSE subroutine at lines 6000-6030 allow you to view various displays as long as desired before proceeding. The form selection subroutine is at lines 7000-7214. Although this listing includes only Form 1040 and Schedule A, you can add any additional forms using the same principles illustrated. The particular variables allow this flexibility. Z is the offset in line numbers for each form with allows all line numbers and descriptions to be stored in a single sequential array but allows you to enter the line numbers on the IRS form. P is the number of “pages” used to display the given form. Each value of J is the starting line for each display page; each value of K is the ending line. This allows overlap of displays as appropriate.

Lines 1000-1120 provide the data entry function and begin with form selection through GOSUB 7000. You are then prompted for line number and amount. The amount is added to the previous total for this line and the new total displayed. This allows periodic updating during the year and revisions during year-end form preparation. Make negative corrections by entering negative numbers.

Lines 2000-2248 perform all arithmetic for lines that require it. Schedule A (lines 2200-2248) must be done first so that Form 1040 (lines 2100-2182) will have that information. Lines 2120-2122 require you to refer to the tax tables for the tax on the amount in Form 1040 line 34. Lines 2124-2126 request any additional taxes. The “bottom line” is displayed by lines 2174-2178. In the calculation of Schedule A, the total deduction is displayed by 2242.

Lines 3000-3080 allow you to view all line items on the form selected. GOSUB 7000 illustrates its usefulness here by allowing a short subroutine to serve for all present and future forms. Line numbers, descriptions and amounts are presented. Changing the line number I to I$ makes for a more attractive display.

Lines 4000-4060 record the program and all variables, including line descriptions and amounts. This also makes the program self-starting upon LOADing and eliminates the danger of erasing everything with a RUN instead of a GOTO.

Lines 5000-5030 erase all line amounts to let you keep the line descriptions intact when starting a new tax year.

Lines 9000-9050 are for initializing the program. The REM statements indicate direct commands that should be entered when the program is being initialized. Line descriptions are typed in by first commanding GOTO 9020. The prompt provides a guide to the maximum length of the description (18 spaces) by printing 16 *s after the line number. The direct command LET J=1 allows later addition of forms and line descriptions. Setting J to the new line number saves previous entries. The number 107 is the total lines in Form 1040 and Schedule A. If you add more forms to the program, you must increase 107 wherever it occurs.

After initializing TAX, enter GOTO 100 to get to the main menu and either begin using it or record it for later use.


Enter all data that cannot be computed on Form 1040 or Schedule A. Run CALCULATE TAX routine on Schedule A first; totals are automatically transferred to Form 1040. For lines on Form 1040 with sub-lines a, b, c and d, enter each sub-item to the main line number. The screen shows the latest entry and the total. You can only go forward through the form; enter zeros until the main menu comes up to go back.–KO

(Mar.82 listings are printed on a Sinclair ZX printer. Comments?)

 100 PRINT AT 3,6;"INCOME TAX RETURN"
110 PRINT AT 6,4;"PRESS DESIRED FUNCTION"
120 PRINT AT 8,6;"1. ENTER DATA"
130 PRINT AT 9,6;"2. CALCULATE TAX"
140 PRINT AT 10,6;"3. REVIEW DATA"
150 PRINT AT 11,6;"4. RECORD DATA"
152 PRINT AT 12,6;"5. ERASE ALL ENTRIES"
155 PAUSE 40000
160 LET K$=INKEY$
170 IF K$<"1" OR K$>"5" THEN GOTO 190
180 GOSUB VAL K$*1000
200 GOTO 100
999 REM [illegible]
1000 GOSUB 7000
1010 PRINT AT 6,8;"LINE NUMBER"
1020 INPUT Y
1030 PRINT AT 6,20;Y
1040 LET X=Y+Z
1050 PRINT AT 8,8;"AMOUNT $"
1060 INPUT A
1070 PRINT AT 8,16;A
1080 LET L(X)=L(X)+A
1090 PRINT AT 10,8;"TOTAL $";L(X)
1100 GOSUB 6000
1120 GOTO 100
1999 REM [illegible]
2000 GOSUB 7000
2020 GOSUB VAL K$*100+2000
2030 RETURN
2099 REM FORM 1040
2100 LET L(21)=0
2102 FOR I=7 TO 20
2104 LET L(21)=L(21)+L(I)
2106 NEXT I
2108 LET L(30)=0
2110 FOR I=22 TO 29
2112 LET L(30)=L(30)+L(I)
2114 NEXT I
2116 LET L(31)=L(21)-L(30)
2117 LET L(32)=L(107)
2118 LET L(34)=L(31)-L(32)-L(33)
2120 PRINT AT 21,0;"ENTER TAX FOR $";L(34)
2122 INPUT L(35)
2124 PRINT AT 21,0;"ENTER ADDITIONAL TAXES "
2126 INPUT L(36)
2128 LET L(37)=L(35)+L(36)
2130 LET L(46)=0
2132 FOR I=38 TO 45
2134 LET L(46)=L(46)+L(I)
2136 NEXT I
2138 LET L(47)=L(37)-L(46)
2140 LET L(54)=0
2142 FOR I=47 TO 53
2144 LET L(54)=L(54)+L(I)
2146 NEXT I
2148 LET L(62)=0
2150 FOR I=55 TO 61
2152 LET L(62)=L(62)+L(I)
2154 NEXT I
2156 LET X=L(62)-L(54)
2158 IF X<0 THEN GOTO 2166
2160 LET L(63)=X
2162 LET L(64)=L(63)-L(65)
2164 GOTO 2174
2166 LET L(63)=0
2168 LET L(64)=0
2170 LET L(65)=0
2172 LET L(66)=X*-1
2174 FOR I=63 TO 66
2176 PRINT AT I-53,0;I;" ";C$(I);" $";L(I)
2178 NEXT I
2180 GOSUB 6000
2182 RETURN
2199 REM [illegible]
2200 LET L(70)=L(68)-L(69)
2202 IF L(69)>L(68) THEN LET L(70)=0
2204 LET L(73)=L(70)+L(71)+L(72)
2206 LET L(74)=.03*L(31)
2208 LET L(75)=L(73)-L(74)
2210 IF L(74)>L(73) THEN LET L(75)=0
2212 LET L(76)=L(67)+L(75)
2214 LET L(82)=L(77)+L(78)+L(79)+L(80)+L(81)
2216 LET L(86)=L(83)+L(84)+L(85)
2218 LET L(90)=L(87)+L(88)+L(89)
2220 LET L(95)=L(91)+L(92)+L(93)+L(94)
2222 LET L(98)=L(96)+L(97)
2224 LET L(99)=L(76)
2226 LET L(100)=L(82)
2228 LET L(101)=L(86)
2230 LET L(102)=L(90)
2232 LET L(103)=L(95)
2234 LET L(104)=L(98)
2236 LET L(105)=L(99)+L(100)+L(101)+L(102)+L(103)+L(104)
2238 LET L(107)=L(105)-L(106)
2240 IF L(106)>L(105) THEN LET L(107)=0
2242 PRINT AT 15,0;"41 ";C$(107);" $";L(107)
2244 GOSUB 6000
2248 RETURN
2999 REM [illegible]
3000 GOSUB 7000
3010 FOR N=1 TO P
3020 FOR I=J(N) TO K(N)
3025 LET I$=STR$ I
3030 PRINT I$;" ";C$(I+Z);" $";L(I+Z)
3040 NEXT I
3050 GOSUB 6000
3070 NEXT N
3080 RETURN
3999 REM RECORD DATA
4000 CLS
4010 PRINT AT 6,7;"PREPARE RECORDER"
4020 PRINT AT 10,3;"PRESS ANY KEY WHEN READY"
4030 PAUSE 40000
4040 CLS
4050 SAVE "TAX"
4060 GOTO 100
4999 REM ERASE ALL ENTRIES
5000 CLS
5005 FOR I=1 TO 107
5010 LET L(I)=0
5020 NEXT I
5030 PRINT AT 10,7;"ALL ENTRIES ERASED"
5999 REM PAUSE
6000 PRINT AT 21,3;"PRESS ANY KEY TO CONTINUE"
6010 PAUSE 40000
6020 CLS
6030 RETURN
6999 REM FORM SELECTION
7000 CLS
7010 PRINT AT 6,7;"PRESS DESIRED FORM"
7020 PRINT AT 8,9;"1. FORM 1040"
7030 PRINT AT 9,9;"2. SCHEDULE A"
7082 PAUSE 40000
7084 LET K$=INKEY$
7086 IF K$<"1" OR K$>"2" THEN GOTO 7000
7088 CLS
7090 GOSUB VAL K$*100+7000
7092 RETURN
7099 REM [illegible]
7100 PRINT AT 0,11;"FORM 10[illegible]"
7102 LET Z=0
7104 LET P=4
7106 LET J(1)=7
7108 LET J(2)=21
7110 LET J(3)=37
7112 LET J(4)=47
7114 LET K(1)=21
7116 LET K(2)=37
7118 LET K(3)=54
7120 LET K(4)=66
7130 RETURN
7200 PRINT AT 0,11;"SCHEDULE A"
7202 LET Z=66
7204 LET P=2
7206 LET J(1)=1
7208 LET J(2)=21
7210 LET K(1)=20
7212 LET K(2)=41
7214 RETURN
8999 REM INITIALIZATION
9000 REM LET J=1
9002 REM DIM J(4)
9004 REM DIM K(4)
9006 REM DIM C$(107)
9008 REM DIM L(107)
9010 REM DIM I$(3)
9012 REM FAST
9020 FOR I=J TO 107
9025 LET I$=STR$ I
9030 PRINT AT 21,0;I$;"****************"
9040 INPUT C$(I)
9050 NEXT I
SYNTACTIC SUM: 52866, 8K

Media

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