Question
while True: # Get input from user name = input(Please enter your name: ) gross_income = float(input(Please enter your gross income: )) dependents = int(input(Please
while True: # Get input from user name = input("Please enter your name: ") gross_income = float(input("Please enter your gross income: ")) dependents = int(input("Please enter the number of dependents: ")) # Calculate taxable income taxable_income = gross_income - 10000 - (3000 * dependents) # Determine tax rate based on taxable income if taxable_income <= 10000: tax_rate = 0.1 elif taxable_income >= 10001 and taxable_income <= 40000: tax_rate = 0.12 elif taxable_income >= 40001 and taxable_income <= 86500: tax_rate = 0.22 elif taxable_income >= 86501 and taxable_income <= 165000: tax_rate = 0.24 else: taxable_income >= 165501 tax_rate = 0.32 # Calculate tax tax = taxable_income * tax_rate # Display results to user print(f"{name}, your taxable income is ${taxable_income:.2f} and your total amount of tax is ${tax:.2f}") # Check if there are more clients more_clients = input("Are there more clients? (yes/no) ") if more_clients.lower() == "no": break When I enter it into the auto grader the calculations are coming out wrong. every number is being multiplied by .32 instead of the right tax rate. How do I fix it?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started