230k views
0 votes
You wrote a program to prompt the user for hours and rate per hour to compute gross pay. Also, your pay computation gives the employee 1.5 times the hourly rate for hours worked above 40 hours.

If hours = 45 and rate = 10, the pay is:

a) 425.0
b) 450.0
c) 475.0
d) 500.0

User Zigdon
by
7.6k points

1 Answer

2 votes

Final answer:

The gross pay for an employee working 45 hours at a rate of $10 per hour, with 1.5 times the hourly rate for hours worked above 40, is $475.0.

Step-by-step explanation:

To solve this mathematical problem, we will calculate the gross pay for an employee who works 45 hours at a rate of $10 per hour with overtime pay. Overtime pay here is 1.5 times the hourly rate for any hour worked above 40 hours. Since the employee worked 45 hours, they worked 5 hours of overtime.

The calculation for the first 40 hours is straightforward: 40 hours × $10/hour = $400.

For the overtime hours, we calculate the extra pay: 5 hours × ($10/hour × 1.5) = $75.

Adding the regular pay with the overtime pay gives us the total gross pay: $400 + $75 = $475.0.

Therefore, the correct answer is c) $475.0.

User Seyet
by
8.8k points