Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

The United States federal personal income tax is calculated based on filing status and taxable income. There are four filing statuses: single filers, married filing

image text in transcribed
The United States federal personal income tax is calculated based on filing status and taxable income. There are four filing statuses: single filers, married filing jointly or qualified widow(er), married filing separately, and head of household. To simplify the problem, we assume that the tax rates for single status and married filing separately status are the same, and the tax rates for married filing jointly status and head of household status are the same. The table below shows a simplified version of rate details (i.e., this is not the real rate table). Here are two examples to help you understand how to use the rate table. 1) If you are single with a taxable income of $20,000, the first $9,700 is taxed at 10% and the remaining amount is taxed at 12%, so your total tax is tiered as $9,70010%+($20,000$9,700)12%. 2) If you are single with a taxable income of $200,000, the first $9,700 is still taxed at 10%, but different rates are applied to income in different brackets and the amount above $160,725 is taxed at 32%, so your total tax is tiered as $9,70010%+($39,475$9,700)12%+($84,200$39,475)22%+($160,725 $84,200)24%+($200,000$160,725)32%. Create a Python program that calculates a user's tax based on the user's income level and tax filing status. Requirements: Ask user to enter a taxable income and tax filing status. Note: you must offer users 4 tax statuses. For example, ask user to enter 1 for single, 2 for married filing separately, 3 for married filing jointly or qualified widow(er), and 4 for head of household. For a tax filing status, you need to use multi-level if-elif-else statements to figure out the tax. Display a message summarizing the user's tax status, income, and tax amount in proper formats. Fix any syntax errors and test your code if you can. For example, for a single with income $200,000, the tax is $45,316.5; with income $100,000, the tax is $18,174.5; with income $60,000, the tax is $9,058.5; with income $20,000, the tax is $2,206.0. For a married-jointly status with income $400,000, the tax is $90,633; with income $200,000, the tax is $36,349; with income $100,000, the tax is $13,717; with income $20,000, the tax is $2,012. Save your file (especially if you can't run it). Submit the python file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions