Respuesta :
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.
The program is a sequential program, and does not require loops and conditional statements
The program in Python, where comments are used to explain each line is as follows:
#This gets input for the salary
salary=float(input("Salary :$"))
#This gets input for the number of dependents
numDependents=int(input("Dependents : "))
#This calculates the state tax
stateTax=salary*0.065
#This calculates the federal tax
federalTax=salary*0.28
#This calculates the dependent deduction
dependentDeduction=salary*0.025*numDependents
#This calculates the total withholding tax
totalWithholding=stateTax + federalTax+ dependentDeduction
#This calculates the net pay
takeHomePay=salary- totalWithholding
#The next 5 lines print the required outputs
print("State Tax: $"+str(stateTax))
print("Federal Tax: $"+str(federalTax))
print("Dependents: $"+str(dependentDeduction))
print("Salary: $"+str(salary))
print("Take-HomePay :$"+str(takeHomePay))
Read more about sequential programs at:
https://brainly.com/question/17970226