dimanche 14 février 2021

How do I subtract a flat-rate healthcare cost from an inputted salary?

I am trying to calculate the net pay of a bi-weekly salary by first subtracting healthcare costs and then calculating the federal tax reduction. I understand how to calculate the tax deduction, but I don't know how to first subtract the healthcare deduction ($800 if single and $1000 if married) from the salary that is inputted prior to doing the tax deductions. This is what I have so far, but I don't know where or how to subtract the flat rate of $800(single) or $1000(married) from the original salary.

salary = float(input('Enter salary: '))
marital_status = input('Enter marital status M for married or S for other: ')

if marital_status is 'S':
    if salary <= 10000:
        print(salary - (salary * .05))
    elif (salary >= 10000.01) and (salary <= 50000):
        print(salary - (500 + (salary * .105)))
    elif salary > 50000:
        print(salary - (4700 + (salary * .2025)))
    
if marital_status is 'M':
    if salary <= 25000.00:
        print(salary - (salary * .625))
    elif salary <= 90000.00:
    print(salary - (500.00 + (salary * .1075)))
    elif salary > 90000:
        print(salary - (8550.00 + (salary * .225)))

Aucun commentaire:

Enregistrer un commentaire