Answer to Question #296831 in Python for Den

Question #296831

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.


1
Expert's answer
2022-02-12T06:58:59-0500
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}")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS