Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 234 569 7 8 taxform.py Program: taxform.py Author: Ken Lambert Compute a person's income tax.|| 1. Significant constants tax rate standard deduction deduction

image text in transcribedimage text in transcribedimage text in transcribed

1 234 569 7 8 taxform.py Program: taxform.py Author: Ken Lambert Compute a person's income tax.|| 1. Significant constants tax rate standard deduction deduction per dependent 10 11 2. The inputs are 12 13 gross income number of dependents 14 3. Computations: 15 taxable income = 16 gross income the standard deduction - a deduction for each dependent 17 18 19 income tax = is a fixed percentage of the taxable income 4. The outputs are the income tax 20 21 22 23 TAX RATE # Initialize the constants = 0.20 21 22 23 23 24 25 26 27 28 29 30 31 32 33 34 45 35 mm 36 37 38 39 mm # Initialize the constants TAX RATE = 0.20 STANDARD_DEDUCTION = 10000.0 DEPENDENT DEDUCTION = 3000.0 # Request the inputs gross Income = float(input("Enter the gross income: 12345.67")) numDependents = int(input("Enter the number of dependents: 1")) # Compute the income tax taxable Income = - \ gross Income - STANDARD_DEDUCTION DEPENDENT_DEDUCTION * numDependents income Tax = max(0, taxable Income * TAX RATE) rounded Income Tax = round(income Tax, 2) # Display the income tax print("The income tax is $" + str(income Tax)) taxform.py X 20 taxform.py PROBLEMS OUTPUT DEBUG CONSOLE Companion X Status: FAILED! Check TERMINAL PORTS 2 @Iedoubina .../9780357881019-fundamentals-of-python-3e-7b0032cf-4d58-4c91-8a0a-9bdbaea00b52/chapte r2/ex01/student (template) $ python/workspaces/9780357881019-fundamentals-of-python-3e-7b0032cf-4d5 8-4c91-8a0a-9bdbaea00b52/chapter2/ex01/student/taxform.py Enter the gross income: 12345.67 Traceback (most recent call last): File "/workspaces/9780357881019-fundamentals-of-python-3e-7b0032cf-4d58-4c91-8a0a-9bdbaea00b52/cha pter2/ex01/student/taxform.py", line 28, in gross Income = float(input("Enter the gross income: 12345.67")) ValueError: could not convert string to float: " @Iedoubina .../9780357881019-fundamentals-of-python-3e-7b0032cf-4d58-4c91-8a0a-9bdbaea00b52/chapte r2/ex01/student (template) $

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

Introduction to Algorithms

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

3rd edition

978-0262033848

More Books

Students also viewed these Algorithms questions