Question

In: Computer Science

Write a Python program that computes the income tax for an individual. The program should ask...

Write a Python program that computes the income tax for an individual. The program should ask the user to enter the total taxable income for the year. The program then uses the tax bracket (as shown below) to calculate the tax amount. This is based on a progressive income tax system which is how income tax is calculated in the U.S. As a result, this for example means that only income above $500,001 is taxed at 37%. Income of lower levels are taxed at their given marginal rate. 10% on taxable income from $0 to $9,525, plus 12% on taxable income over $9,526 to $38,700, plus 22% on taxable income over $38,701 to $82,500, plus 24% on taxable income over $82,501 to $157,500, plus 32% on taxable income over $157,501 to $200,000, plus 35% on taxable income over $200,001 to $500,000, plus 37% on taxable income over $500,001 or more.

Solutions

Expert Solution

income = float(input("Enter income: "))
tax = 0
if(income <= 9525):
    tax = income*0.10
elif(income <= 38700):
    tax = (9525 * 0.10) + (income-9525)*0.12
elif(income <= 82500):
    tax = (9525 * 0.10) + (38700-9525)*0.12 + (income-38700)*0.22
elif(income <= 157500):
    tax = (9525 * 0.10) + (38700-9525)*0.12 + (82500-38700)*0.22 + (income-82500)*0.24
elif(income <= 200000):
    tax = (9525 * 0.10) + (38700-9525)*0.12 + (82500-38700)*0.22 + (157500-82500)*0.24 + (income-157500)*0.32
elif(income <= 500000):
    tax = (9525 * 0.10) + (38700-9525)*0.12 + (82500-38700)*0.22 + (157500-82500)*0.24 + (200000-157500)*0.32 + (income-200000)*0.35
else:
    tax = (9525 * 0.10) + (38700-9525)*0.12 + (82500-38700)*0.22 + (157500-82500)*0.24 + (200000-157500)*0.32 + (500000-200000)*0.35 + (income-500000)*0.37
print("Tax =",tax)


Related Solutions

Write a Python program that computes the income tax for an individual. The program should ask...
Write a Python program that computes the income tax for an individual. The program should ask the user to enter the total taxable income for the year. The program then uses the tax bracket (as shown below) to calculate the tax amount. This is based on a progressive income tax system which is how income tax is calculated in the U.S. As a result, this for example means that only income above $500,001 is taxed at 37%. Income of lower...
In python. Projectile motion: Write a python program that will ask the user for      an...
In python. Projectile motion: Write a python program that will ask the user for      an initial height y0, initial velocity v, launch angle theta, and mass m.      Create two functions, one that will calculate max height      of the projectile, and one that will calculate the range. Ask the     user which one he/she would like to calculate, then present them with the answer. (use kg, m and m/s)
Calculating Delivery Cost Program in Python write a program in Python that will ask a user...
Calculating Delivery Cost Program in Python write a program in Python that will ask a user to enter the purchase total, the number of the items that need to be delivered and delivery day. Then the system displays the cost of delivery along with the total cost. Purchase total > $150 Yes Number of the items (N) N<=5 N>=6 Delivery day Same Day Next Day Same Day Next Day Delivery charges ($) 8 N * 1.50 N * 2.50 N...
Write a program that computes the tax and tip on a restaurant bill for a patron...
Write a program that computes the tax and tip on a restaurant bill for a patron with $44.50 meal charge. The tax should be 6.75% of the meal cost. The tip should be 15% of the total after adding tax. Display the meal cost, tax amount, tip amount, and total bill on the screen. (I need this to be in OOP using C++)
Write a program that computes the tax and tip on a restaurant bill for a patron...
Write a program that computes the tax and tip on a restaurant bill for a patron with $44.50 meal charge. The tax should be 6.75% of the meal cost. The tip should be 15% of the total after adding tax. Display the meal cost, tax amount, tip amount, and total bill on the screen. (I need this to be in OOP).
In your python program, ask the user to enter the annual income of an employee and...
In your python program, ask the user to enter the annual income of an employee and the years of experience. Pass these data to a function. The function decides if an employee does qualify for a loan or does not, then it prints a message based on the following rules: If the income is equal or greater than $40000, the function checks if the employee’s years of experience is greater than 4, if so the employee gets $6000 loan; otherwise,...
Python programming c++ Write a program that computes the amount of money the cheerleaders raised during...
Python programming c++ Write a program that computes the amount of money the cheerleaders raised during their candy bar fundraiser using the following data: 12 bars per case. The candy was sold for $1.00 per bar. Each case cost $8.00. They are required to give the student government association 10% of their earnings. The program should ask the user how many bars were sold. The program should calculate and display the SGA proceed's, the Cheer team's proceeds, and the appropriate...
Write a Python program that computes certain values such as sum, product, max, min and average...
Write a Python program that computes certain values such as sum, product, max, min and average of any 5 given numbers along with the following requirements. Define a function that takes 5 numbers, calculates and returns the sum of the numbers. Define a function that takes 5 numbers, calculates and returns the product of the numbers. Define a function that takes 5 numbers, calculates and returns the average of the numbers. Must use the function you defined earlier to find...
Python Program Write a program that will ask a user on how many input colored balls...
Python Program Write a program that will ask a user on how many input colored balls of the following codes: R-red, B-blue, W-white, G-green and O-orange -will he or she would like to enter in the program and print the total number of Red balls were encountered. Assume an uppercase and lower case letter will be accepted.
Write a Python program that has a loop to continuously ask the user for a number,...
Write a Python program that has a loop to continuously ask the user for a number, terminating the loop when the number entered is -1. Inside the loop, 1.) display one asterisk(*) if the number is 1, 2.) two asterisk(**) if the number is 2 and 3.) "OTHER" if the number is any other number.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT