subject
Engineering, 07.04.2020 20:21 gypsybrio1512

Python Homework

Instructions:

The tax calculator program of the case study outputs a floating-point number that might show more than two digits of precision.

Use the round function to modify the program to display at most two digits of precision in the output number.

Below is an example of the program input and output:

Enter the gross income: 12345.67

Enter the number of dependents: 1

The income tax is $-130.87

# Edit the code below

"""
Program: taxform. py
Author: Ken Lambert
Compute a person's income tax.
1. Significant constants
tax rate
standard deduction
deduction per dependent
2. The inputs are
gross income
number of dependents
3. Computations:
taxable income = gross income - the standard deduction -
a deduction for each dependent
income tax = is a fixed percentage of the taxable income
4. The outputs are
the income tax
"""

# Initialize the constants
TAX_RATE = 0.20
STANDARD_DEDUCTION = 10000.0
DEPENDENT_DEDUCTION = 3000.0

# Request the inputs
grossIncome = float(input("Enter the gross income: "))
numDependents = int(input("Enter the number of dependents: "))

# Compute the income tax
taxableIncome = grossIncome - STANDARD_DEDUCTION - \
DEPENDENT_DEDUCTION * numDependents
incomeTax = taxableIncome * TAX_RATE

# Display the income tax
print("The income tax is $" + str(incomeTax))

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Determine whether or not it is possible to compress air adiabatically from k to 140 kpa and 400 k. what is the entropy change during this process?
Answers: 3
question
Engineering, 04.07.2019 18:10
The filament of an incandescent lamp has a temperature of 2000k. calculate the fraction of radiation emitted in the visible light band if the filament is approximated as blackbody
Answers: 2
question
Engineering, 04.07.2019 18:10
Burgers vector is generally parallel to the dislocation line. a)-true b)-false
Answers: 2
question
Engineering, 04.07.2019 18:20
Vibration monitoring this technique uses the noise or vibration created by mechanical equipment and in seme cases by plant systems to detemine their actual condtion. a)- true b)- false
Answers: 2
You know the right answer?
Python Homework

Instructions:

The tax calculator program of the case study o...
Questions
question
Mathematics, 04.12.2021 01:10
question
English, 04.12.2021 01:10
Questions on the website: 13722367