Question: Write code to complete the calculatePay function. It takes in the number of hours worked and an hourly pay rate. If the hours worked are

Write code to complete the calculatePay function. It takes in the number of hours worked and an hourly pay rate. If the hours worked are less than 40, it should just return the hours times the hourly pay. If more than 40 hours were worked, the person should earn normal pay for 40 hours and 1.5 times the normal pay for the hours over 40. So if someone worked 50 hours, at $18 per hour they would receive

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!