Social Security Benefits Tax

Developer(s): Joan Kealy
Date: 1992
Type: Program
Platform(s): TS 2068
Tags: Tax

Works out how much of your Social Security benefits is taxable, following the IRS worksheet line by line. You first pick one of four filing statuses, which sets the base amount: $25,000 for a single taxpayer or a married person who lived apart from their spouse all year and files separately, $32,000 for a married couple filing jointly, and $0 for a married couple filing separately after living together for any part of the year. The program then asks for taxable income, adjustments from the 1040, tax-exempt income, foreign income and half of your Social Security benefits, and prints each figure and running total as a numbered worksheet line. If the total is over the base amount, half of the excess is compared with half the benefits, and the smaller figure is shown as the taxable amount to add to your other income on the 1040. Otherwise it reports that no tax is due on the benefits. Figures are entered without dollar signs and rounded to the nearest dollar.

The opening screen reads “DETERMINING THE TAXABLE AMOUNT OF YOUR SOCIAL SECURITY BENEFITS”, and a REM in line 10 says that it is based on the August 1991 “Financial Focus” from Scudder. The program came with Joan Kealy’s article “Deriving Your Tax Threshold from Your Voting Status” in ZXir QLive Alive! (Spring 1992). “Voting status” is the article’s own wording for filing status. Besides the program, the newsletter’s Issue 4 disk holds the article’s printed menu screen and two sample runs. The thresholds are the ones in force for 1991.

Program Analysis

Structure

Lines 10–40 show the title and instructions and wait with PAUSE 1000. Lines 50–90 print the four filing statuses, accept a choice from 1 to 4 and set the threshold TH. Lines 100–180 take each figure as a string with INPUT, print it right-aligned on its worksheet line with AT row,31-LEN, and work the totals with VAL. Line 190 stops with a no-tax message if the amount over the threshold is zero or less. Lines 200–230 halve the excess and print whichever is smaller, the line 6 or the line 10 figure, as the taxable amount, and line 240 waits for a key.

Notable Techniques

  • Each figure is read into a string (I$, A$, X$, F$, B$) so that it can be echoed exactly as typed and right-justified with LEN, then converted with VAL for the arithmetic.
  • The screen layout copies the numbered lines of the paper worksheet, so the result can be checked against the IRS form.

Potential Issues

  • If half the benefits exactly equals half the excess, neither line 220 (VAL B$<R3) nor line 230 (R3<VAL B$) is true, and no taxable amount is printed.
  • Line 60 rejects only values below 1 or above 4. A fractional entry such as 1.5 sets no threshold, and the program stops at line 170 with a variable-not-found error.
  • The user must enter half of the benefits rather than the full amount, and a non-numeric entry stops the program at the VAL.
  • The $25,000 and $32,000 base amounts are the 1991 figures and are out of date.

This copy came from a Larken disk. For tape, the RANDOMIZE USR 100 disk calls and the load of the disk’s menu program were removed, the final jump back to that menu was replaced by STOP, the autostart was set to line 10 and the disk’s variables marker was dropped. It was tested in ZEsarUX with the disk’s own sample figures and reproduces the sample run’s taxable amount.

Related Articles

Calculate income tax rates. Program included.

Image Gallery

Source Code

   10 CLS : LET A=0: REM BASED ON 8/91 "FINANCIAL FOCUS" FROM SCUDDER
   20 PRINT AT 10,0;" DETERMINING THE TAXABLE AMOUNT OF YOUR SOCIAL SECURITY BENEFITS": PRINT AT 15,0;"ENTER NO $$$ SIGNS WITH FIGURES;"
   30 PRINT '"  ROUND TO THE NEAREST DOLLAR.  "
   40 PAUSE 1000: CLS : PRINT "DERIVING YOUR THRESHOLD FROM    YOUR VOTING STATUS:"
   50 PRINT '"ARE YOU";''"(1)SINGLE TAXPAYER FILING AS AN INDIVIDUAL?";''"(2)MARRIED BUT LIVING APART FROMSPOUSE FOR ENTIRE YEAR & FILING SEPARATELY?";''"(3)A MARRIED COUPLE FILING JOINT-LY?";''"(4)A MARRIED COUPLE FILING SEP- ARATELY AFTER LIVING TOGETHER   ANY PART OF THE YEAR?"
   60 INPUT "NUMBER OF CORRECT STATUS?",A: IF A>4 OR A<1 THEN GO TO 60
   70 IF A=1 OR A=2 THEN LET TH=25000
   80 IF A=3 THEN LET TH=32000
   90 IF A=4 THEN LET TH=0
  100 CLS : INPUT "TOTAL OF TAXABLE INCOME",I$: PRINT AT 1,0;"1. TAXABLE INCOME";AT 1,31-LEN I$;I$
  110 INPUT "FROM IRS 1040-ADJUSTMENTS TO    INCOME?",A$: PRINT AT 2,0;"2. -ADJUSTMENTS";AT 2,31-LEN A$;A$
  120 LET R1=VAL I$-VAL A$: PRINT AT 3,0;"3. RESULT (#1-#2)";AT 3,31-LEN STR$ R1;R1
  130 INPUT "TAX-EXEMPT INCOME?",X$: PRINT AT 4,0;"4. +EXEMPT INCOME";AT 4,31-LEN X$;X$
  140 INPUT "FOREIGN INCOME NOT SHOWN IN #1",F$: PRINT AT 5,0;"5. +FOREIGN INCOME";AT 5,31-LEN F$;F$
  150 INPUT "1/2 OF SOCIAL SECURITY BENEFITS?",B$: PRINT AT 6,0;"6. +HALF SS";AT 6,31-LEN B$;B$ 
  160 LET R2=R1+VAL X$+VAL F$+VAL B$: PRINT AT 7,0;"7. RESULT (#3+4+5+6)";AT 7,31-LEN STR$ R2;R2
  170 PRINT AT 8,0;"8. -THRESHOLD";AT 8,31-LEN STR$ TH;TH
  180 LET AM=R2-TH: PRINT AT 9,0;"9. AMOUNT OVER THRESHOLD";AT 9,31-LEN STR$ AM;AM 
  190 IF AM<=0 THEN PRINT "NO TAX ON YOUR SOCIAL SECURITY  BENEFITS!": STOP 
  200 LET R3=AM*.5: PRINT AT 10,0;"10. MULTIPLY BY .5";AT 10,31-LEN STR$ R3;R3
  210 PRINT AT 14,0;"THE TAXABLE AMOUNT TO BE ADDED  TO YOUR OTHER TAXABLE INCOME ON THE IRS 1040 IS THE SMALLER OF  LINE 6 OR 10."
  220 IF VAL B$<R3 THEN PRINT AT 21,4;"$";VAL B$;" TAXABLE AMOUNT"
  230 IF R3<VAL B$ THEN PRINT AT 21,4;"$";R3;" TAXABLE AMOUNT"
  240 PAUSE 0
  250 GO TO 9998
 9980 STOP 
 9992 CLEAR : RANDOMIZE USR 100: SAVE "SOCTAX.B1" LINE 10
 9998 RANDOMIZE USR 100: LOAD "L.B1"

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