Question: Create a program called Lab1B in C++ that will calculate an employees pay for the week. Ask the user for the employees pay rate and

Create a program called Lab1B in C++ that will calculate an employees pay for the week.

Ask the user for the employees pay rate and the total hours that the employee worked during the week. (I recommend making the variables for these doubles.)

If totalHours is greater than 40 then

regularHours = 40

calculate how many overtime hours they worked (hours over 40),

calculate regular pay as 40 * pay rate

calculate overtime pay as overtime hours * pay rate * 1.5

Add overtime pay and regular pay to get their total pay

print the output as follows:

regularHours regular Hours and overtimeHours overtime at payRate = totalPay

else do the following

regularHours = totalHours

Calculate total pay as total hours * pay rate

print the output as follows:

regularHours regular at payRate = totalPay

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 Databases Questions!