Question: This program reads two values. The first is an hourly wage (double) and the second is the number of hours worked (integer) in a week.
This program reads two values. The first is an hourly wage (double) and the second is the number of hours worked (integer) in a week. The program will compute the total weekly pay based on the following guide.
- Regular time, 0 to 40 hours, use the regular hourly rate
- Overtime, 41-50 hours, regular rate for the first 50 hours and 1.5 times hourly rate for hours over 40.
-Double-time, 51 or more hours, regular rate for the first 40 hours, 1.5 times the hourly rate for the next 10 hours, and 2.0 times the hourly rate for all hours over 50.
Entering 8.50 and 25 gives a weekly pay of $212.50
because 8.5*25(regular) = 212.50
Entering 12.50 and 45 gives a weekly pay of $593.75
because 12.5*40(regular)+12.5*1.5*5(overtime)= 593.75
Entering 17.50 and 65 gives a weekly pay of $1487.50
because 17.5*40(regular)+17.5*1.5*10(overtime) + 17.5*2*15(double-time) = 1487.50
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
