Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Rules In Database Systems Third International Workshop Rids 97 Sk Vde Sweden June 26 28 1997 Proceedings Lncs 1312

Authors: Andreas Geppert ,Mikael Berndtsson

1997th Edition

3540635165, 978-3540635161

More Books

Students also viewed these Databases questions