Medicare Income Tax

Developer(s): Herb Bowers
Date: 1989
Type: Program
Platform(s): TS 2068
Tags: Tax

Medicare Income Tax calculates the supplemental Medicare premium, the income surtax enacted in 1988 to pay for catastrophic illness coverage, for each of the tax years 1989 to 1993. You give your filing status (1 to 5), whether you and your spouse both qualify for Medicare Part A, whether you lived together during the year, and your federal income tax liability from your last return. The program prints a table of the surtax for each year, capped at that year’s legislated maximum, with options to COPY the screen to the printer, do another, or quit.

The program is by Herb Bowers, whose listing was reprinted in 1989 and 1990 by many user group newsletters (linked below). This is a TS2068 version: it reads its menu keys with INKEY$ and turns on caps lock with POKE 23658,8.

Program Analysis

Line 100 holds the rate per $150 of tax and the maximum for each of the five years; lines 150–170 read them into r() and s(). The surtax is DEF FN A(F)=TAX/150*R(f). When both spouses qualify or lived together the yearly maximums are doubled (line 1210); for filing status 2 the tax liability is split between the spouses (1230) and the result doubled again when both qualify (1270). Liabilities under $150 owe nothing. Lines 1340–1350 print the table, right-aligning the amounts by adding the results of comparisons to the TAB position.

Notable Techniques

  • Boolean arithmetic for alignment: TAB 20+(t(f)<1000)+(t(f)<100)+(t(f)<10).
  • Yes/no answers stored as truth values, LET q=INKEY$="Y", and printed back with "YES" AND q;"NO" AND NOT q.

Potential Issues

  • The living-together question (lines 1110–1150) is asked only for filing status 3.
  • The prompt at line 1110 misspells “spouse”.

This copy came from a Larken disk. For tape, the disk save and menu lines at the end were removed; the program keeps the tape name “medicaretx” it was given originally. Tested in ZEsarUX.

Related Articles

TS1000 BASIC program (approximately 2K) that calculates the Medicare catastrophic illness income surtax enacted for tax years 1989-1993.

Image Gallery

Source Code

   10 DEF FN A(F)=TAX/150*R(f)
  100 DATA 22.5,800,37.5,850,39,900,40.5,950,42,1050
  110 POKE 23658,8: POKE 23609,10
  120 CLS : LET q=0: LET t=0
  130 DIM r(5): DIM s(5)
  140 DIM t(5)
  150 FOR f=1 TO 5
  160 READ r(f),s(f)
  170 NEXT f
 1000 PRINT "MEDICARE INCOME TAX"
 1010 PRINT "WHAT'S YOUR FILING STATUS? (1-5)"
 1020 IF INKEY$="" OR INKEY$<"1" OR INKEY$>"5" THEN GO TO 1020
 1030 LET fs=VAL INKEY$: PRINT ,fs
 1040 IF fs<>2 AND fs<>3 THEN GO TO 1160
 1050 PRINT '"DO BOTH YOU AND SPOUSE QUALIFY  FOR MEDICARE, PART A ? (Y/N)"
 1060 IF INKEY$="" OR INKEY$<>"Y" AND INKEY$<>"N" THEN GO TO 1060
 1070 LET q=INKEY$="Y"
 1080 PRINT ,"YES" AND Q;"NO" AND NOT q
 1090 IF fs=2 THEN GO TO 1160
 1110 PRINT '"DID YOU AND YOUR SPOUCE LIVE TO-GETHER AT ANY TIME DURING THE YEAR ?"
 1120 IF INKEY$<>"" THEN GO TO 1120
 1130 IF INKEY$="" OR INKEY$<>"Y" AND INKEY$<>"N" THEN GO TO 1130
 1140 LET t=INKEY$="Y"
 1150 PRINT ,"YES" AND t;"NO" AND NOT t
 1160 PRINT '"ENTER TAX LIABILITY FROM YOUR   LAST FEDERAL INCOME TAX RETURN"
 1170 INPUT tax: PRINT ,"$";tax
 1180 INPUT "IS THE ABOVE CORRECT ?", LINE q$
 1190 IF q$(1)="N" THEN RUN 
 1200 FOR f=1 TO 5
 1210 IF t OR q THEN LET s(f)=s(f)*2
 1220 NEXT f
 1230 IF fs=2 THEN LET tax=tax/2
 1240 FOR f=1 TO 5
 1250 IF tax<150 THEN GO TO 1290
 1260 LET t(f)=FN a(f)
 1270 IF (fs=2 AND q) OR t THEN LET t(f)=t(f)*2
 1280 IF t(f)>s(f) THEN LET t(f)=s(f)
 1290 NEXT f
 1300 CLS 
 1310 PRINT 'TAB 5;"MEDICARE INCOME TAX"
 1320 PRINT 'TAB 5;"YEAR";TAB 21;"TAX"
 1330 FOR f=1 TO 5
 1340 IF t(f)>s(f) THEN LET t(f)=s(f)
 1350 PRINT ''TAB 5;f+1988;TAB 20+(t(f)<1000)+(t(f)<100)+(t(f)<10);INT t(f)
 1360 NEXT f
 1370 PRINT AT 21,3;"COPY   DO ANOTHER   QUIT"
 1380 IF INKEY$="C" THEN PRINT AT     21,0;TAB 31                      : COPY                          : GO TO 1370
 1390 IF INKEY$="D" THEN RUN 
 1400 IF INKEY$="" THEN GO TO 1370
 1410 STOP 
 9989 STOP 
 9991 REM  removed (LKDOS-only)
 9992 REM  removed (LKDOS-only)
 9993 STOP 
 9998 REM  removed (LKDOS-only)
 9999 CLEAR : SAVE "medicaretx" LINE 100: SAVE "medicaretx" LINE 100: SAVE "medicaretx" LINE 100: VERIFY "": VERIFY "": VERIFY ""

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