Answer:
salary=float(input("Please enter your salary: "))
numDependents=int(input("Please specify the number of dependents: "))
stateTax=salary*0.065
federalTax=salary*0.28
dependentDeduction=salary*0.025*numDependents
totalWithholding=stateTax + federalTax + dependentDeduction
takeHomePay=salary - totalWithholding
print("State Tax: $", str(stateTax))
print("Federal Tax: $", str(federalTax))
print("Dependents: $", str(dependentDeduction))
print("Salary: $", str(salary))
print("Take-Home Pay: $", str(takeHomePay))
Explanation:
- Acquire the salary input from the user.
- Gather the number of dependents as input from the user.
- Compute the state tax and federal tax, then calculate the dependent deduction by multiplying the salary by 0.025 and the number of dependents.
- Subsequently, determine the total withholding and calculate take-home pay by deducting the total withholding from the salary.
- Lastly, display all the relevant information.