3. In the U.S., all earned income is subject to federal income tax. The tax system is divided into brackets so that higher earners pay a higher percentage of their income in tax. In the 2022 tax year (which is what you're filing taxes for this spring), the brackets were set up like this for a single filer: A common misconception is that if you'so near the border between two brackets, it's advantageous to refuse a small raise because you would end up with less after-tax pay if you get bumped into the next higher bracket. This is totally false. The tax rates in the table above are marginal, which means they apply only to the portions of income in each range, rather than all of the income. Thus, earning more income will generally result in more after-tax pay. There are some exceptions, such as an income increase disqualifying a taxpayer for the Earned Income Thx Credit!. but we won't consider those special cases here. Note that federal tax is not the only thing withheld from your paycheck. There are also deductions for Social Security and Medicare (known as FICA taxes), state income tax (thankfully zero if you live in Tennessee), retirement contributions, insurance premiums, and so on. But for this problem, we'll focus on just the federal tax. Here are two examples of how the federal tax is computed. - Alice earns $100,000 as a software engineer. Her income can be broken down into four parts: - The first $10,275 incurs 10% of tax: $10,2750.1=$1,027.50 - The part between $10,275 and $41,775 incurs 12% of tax: ($41,775$10,275)0.12 =$3,780 - The part between $41,775 and $89,075 incurs 22% of tax: ($89,075$41,775)0.22 =$10,406 - Finally, the part over $89,075 incurs 24% of tax: ($100,000$89,075)0.24=$2,622 Alice's total tax owed is thus $1,027.50+$3,780+$10,406+$2,622=$17,835.50. Her effective tax rate is $17,835.50/$100,000 or about 17.8%. - Bob earns $41,775 as a sloth trainer. His income can be broken down into two parts: - The first $10,275 incurs 10% of tax: $10,2750.1=$1,027.50 If you're iuterented in U.S. tax Liws, see bttps://wus.irs.gov/credits-deductions/individuala/ earned-income-tax-credit for more info about the EITC, It's good bedtime rending. Page 4 of 7 - The part between $10,275 and $41,775 incurs 12% of tax: ($41,775$10,275)0.12 =$3,780 Bob's total tax owed is thus $1,027.50+$3,780=$4,807.50. His effective tax rate is $4,807.50/$41,775 or about 11.5%. Your task in this problem is to write a program that computes the federal tax owed for any salary. After you're done, maybe you can start your own company to compete with H\&R Block! (a) (6 points) Before writing a program, it can be helpful to work out some test cases: program inputs with known outputs. In addition to producing concrete test data to use later, the process of working out the test cases often provides insight into how to solve the problem. This technique is called test-driven development. Neatly write or type how the tax owed and effective tax rate would be computed for three different incomes. Clearly show all of your calculations. You can pick your own numbers for the incomes, but they must be in three different tax brackets, and they must not repeat the Alice and Bob examples provided earlier. (b) (10 points) Write a program named tax calculator,py that takes user input for 2021 income earned and computes the tax owed and effective tax rate. You may assume that the user will always enter a valid income. Your program should also provide a bracket-bybracket breakdown of how the tax owed was computed. Round off all monetary amounts to two decimal places, and round off the effective tax rate to one decimal place. Verify that your program works correctly using the earlier examples, as well as your own test cases. b) (10 points) Write a program named tax calculator.py that takes user input for 2021 income earned and computes the tax owed and effective tax rate. You may assume that the user will always enter a valid income. Your program should also provide a bracket-bybracket breakdown of how the tax owed was computed. Round off all monetary amounts to two decimal places, and round off the effective tax rate to one decimal place. Verify that your program works correctly using the earlier examples, as well as your own test cases. Example program run (underlined parts indicate what the user enters) What was your 2022 income? 100000 First$10275:$10275$41775:$41775$89075;$89075$170050:Totaltaxoved:Effectivetaxrate:$$$$$1027.503780.0010406.002622.0017835.5017.8%