Hello All,
I am new to Python and I am now taking a required course. I am working on a Case Study that requires me to alter the Round Function, which I am having trouble doing. I was able to alter the entire code and get rid of the Round function, but I don't quite get how ro alter it to get the same output. Would someone be able to assist. I would greatly appreciate any and all help. Here is the code and output:
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(round(incomeTax, 2)))
Output:
Enter the gross income: 10000
Enter the number of dependents: 3
The income tax is $-1800.0