Question: q4) CONSIDER THE FOLLOWING CODE: Using the following input: 10, 17, 45, 20, 35, 20 void Question() { int Employees = 3; double PayRate; double

q4)

CONSIDER THE FOLLOWING CODE: Using the following input: 10, 17, 45, 20, 35, 20 void Question() { int Employees = 3; double PayRate; double GrossPay; double OverTime; int Hours; cout << "Enter the hours worked by " << Employees << " who all earn the same hourly rate :" << endl; for (int index = 0; index < Employees; index++) { cout << "Employee # " << (index + 1) << " :"; cin >> Hours; cout << "Enter each Employee hourly rate:"; cin >> PayRate; if (Hours > 40) { GrossPay = 40 * PayRate; OverTime = ((Hours - 40)*(1.5 * PayRate)); GrossPay += OverTime; } else GrossPay = Hours * PayRate; cout << "Employee # " << (index + 1) << " :$ " << GrossPay << endl; } } GrossPay values are:

Select one:

a. Employee # 1 :$ 170 Employee # 2 :$ 850 Employee # 3 :$ 720

b. Employee # 1 :$ 150 Employee # 2 :$ 850 Employee # 3 :$ 710

c. Employee # 1 :$ 100 Employee # 2 :$ 850 Employee # 3 :$ 700

d. Employee # 1 :$ 170 Employee # 2 :$ 950 Employee # 3 :$ 700

please explain how you get the answer. Thank you

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!