Workers of Maunlad Corp. have 40 regular working hours per week and are paid with an hourly rate based
on their years of service in the company.
Years of service Hourly Rate
1 90
2 – 3 130
4 – 5 160
6 and above 200
However, if a worker rendered more than 40 hours in a week, the excess hours are paid 75% more. Design a program that allows the user to input the worker’s years of service and the number of hours rendered by a worker in 1 week then display the salary.
years=int(input("Input the worker's years of service: "))
numbeHours=int(input("Input the number of hours rendered by a worker in 1 week: "))
hourlyRate=90
if(years==2 or years==3):
hourlyRate=130
if(years==4 or years==5):
hourlyRate=160
if(years>=6):
hourlyRate=200
salary=numbeHours*hourlyRate
if numbeHours>40:
salary+=0.75*salary
print(f"The salary: {salary}")
Comments
Leave a comment