You are on page 1of 1

Create a program using phyton that will identify the Tax of an employee based on

the following salary computation.


Number of Hours for a month:
Rate per Hour:
Rice Allowance:
Travel Allowance:
Clothing Allowance:

Your total salary per month is


Your Tax per month based on the 32% per year is 13600

def calculate_tax(hours: float, rate: float, rice_allowance: float,


travel_allowance: float, clothing_allowance: float) -> float:
total_salary = hours * rate + rice_allowance + travel_allowance +
clothing_allowance
annual_salary = total_salary * 12
tax_rate = 0.32
annual_tax = annual_salary * tax_rate
monthly_tax = annual_tax / 12
return monthly_tax

hours = float(input("Number of Hours for a month: "))


rate = float(input("Rate per Hour: "))
rice_allowance = float(input("Rice Allowance: "))
travel_allowance = float(input("Travel Allowance: "))
clothing_allowance = float(input("Clothing Allowance: "))

monthly_salary = hours * rate + rice_allowance + travel_allowance +


clothing_allowance
monthly_tax = calculate_tax(hours, rate, rice_allowance, travel_allowance,
clothing_allowance)

print(f"\nYour total salary per month is {int(monthly_salary)}")


print(f"Your Tax per month based on the 32% per year is {int(monthly_tax)}")

You might also like