Answer:
salary=float(input("Enter salary : "))
numDependents=int(input("Enter 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:
- Take the salary as input from user.
- Take number of dependents as an input from user.
- Calculate the state tax and Federal Tax. Then calculate the independent detection tax by multiplying salary with 0.025 as well as number of dependents.
- After that calculate total withholding and then calculate home pay by subtracting total withholding from salary.
- Finally print all the details.