Answer:
salary = 1250
numofDependents = 2
stateTax = (6.5/100)*salary
federalTax = (28/100)*salary
dependentDeduction = ((2.5/100)*salary)*(numofDependents)
totalWithHolding = stateTax+federalTax+dependentDeduction
takeHomePay = salary - totalWithHolding
print('State Tax: {}'.format(stateTax))
print('Federal Tax: {}'.format(federalTax))
print('Dependents: {}'.format(dependentDeduction))
print('Salary: {}'.format(salary))
print('Take Home: {}'.format(takeHomePay))
MODIFIED TO ACCEPT FOR SALARY AND NUMBER OF DEPENDENTS
salary = float(input("Please enter your salary: "))
numofDependents = int(input("How many dependents do you have "))
stateTax = (6.5/100)*salary
federalTax = (28/100)*salary
dependentDeduction = ((2.5/100)*salary)*(numofDependents)
totalWithHolding = stateTax+federalTax+dependentDeduction
takeHomePay = salary - totalWithHolding
print('State Tax: {}'.format(stateTax))
print('Federal Tax: {}'.format(federalTax))
print('Dependents: {}'.format(dependentDeduction))
print('Salary: {}'.format(salary))
print('Take Home: {}'.format(takeHomePay))
Step-by-step explanation:
See the attached screen shot for the input and program output
The input Statement in python is used to receive and store the values for salary and number of dependents