For this assignment, each student will write a program to estimate federal tax obligations and effective tax rate.
The United States Internal Revenue Service collects taxes from those who earn income in the United States. Ignoring all tax deductions and loopholes, those who earn more are require to contribute a higher percentage of their income. The following table shows the tax brackets for 2022.
|Rate||Single Filers||Married Joint Filers|
|10%||$0 to $10,275||$0 to $20,550|
|12%||$10,276 to $41,775||$20,551 to $83,550|
|22%||$41,776 to $89,075||$83,551 to $178,150|
|24%||$89,076 to $170,050||$178,151 to $340,100|
|32%||$170,051 to $215,950||$340,101 to $431,900|
|35%||$215,951 to $539,900||$431,901 to $647,850|
Note that the first $10,275 of all single filers income is taxed at the 10% rate, the next $31,500 (= 41,775 - 10,275) is taxed at 12%, etc... For example, taxes due for a single filer with $66,480 in income would be $10,243, which is calculated as follows: 0.10 x 10275 + 0.12 x 31500 + 0.22 x 24705. Note: tax obligations are rounded to the nearest whole dollar.
The effective tax rate is calculated as the amount of taxes due divided by the total income. In our specific example this would be 15.4% = 100% x ($10243/$66480).
Write a program that asks the user if they are a single filer or married joint filer. It should then ask for their expected earned income for 2022 and display the estimated taxes they will be required to pay by April 15, 2023 as well as their effective tax rate.
You may develop your own technique for determining if the user is a single or married joint filer, but it must be obvious to the user when the program is run (provide clear instructions).
Your program must be in a class called
CalculateTaxes in a package that matches your
MSOE username (email address without the @msoe.edu).
A sample program interaction for the program is shown below:
Are you a single filer or a married joint filer (enter 's' or 'j'): s Enter an estimate of your earned income for 2022: 66480.00 Your estimated taxes for 2022 are: $10243 This results in an 15.4% effective tax rate.
Note: You do not need to have the correct number of digits after the decimal place for the effective tax rate.
This laboratory assignment was developed by Dr. Chris Taylor.