Respuesta :

Using the Round Function to modify the program the program is now written as follows:

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(round(incomeTax,2))).

What is the Round Function?

In Python, the Round Function is sued to being the display values to display an intended amount of decimals, hence the rounding function.

It should be noted that the round function requires two inputs:

  • the value to be rounded and
  • the number of precision digits.

The round function will round the Income Tax to two decimal places if we use 2 as the second argument.

The round function must be enclosed within the str function in order for the rounded value to be turned to a string and then linked with another string to display the entire income tax phrase.

Learn more about Round Function at:
https://brainly.com/question/15077869
#SPJ1

Ver imagen azikennamdi