Question: #include #include using namespace std; // Function Prototypes: bool isValidHours(int); float calcPay(int, float); float calcAveragePay(float, int); int main() { int num_employees, hours; float total_pay =

#include  #include  using namespace std; // Function Prototypes: bool isValidHours(int); float calcPay(int, float); float calcAveragePay(float, int); int main() { int num_employees, hours; float total_pay = 0, pay_rate, avg_pay, pay; cout << "Enter the number of employees: "; cin >> num_employees; while(num_employees < 1) { cout << "ERROR: Number of Employees must be at least 1." << endl << "Enter the number of employees: "; cin >> num_employees; } cout << fixed << setprecision(2); for(int i = 1; i <= num_employees; i++) { cout << " Enter number of hours worked by Employee " << i << ": "; cin >> hours; while(!isValidHours(hours)) // Function Call { cout << "ERROR: Hours must be between 1 and 40." << endl << "Enter number of hours worked by Employee " << i << ": "; cin >> hours; } cout << "Enter the pay rate for Employee " << i << ": "; cin >> pay_rate; pay = calcPay(hours, pay_rate); // Function Call total_pay += pay; cout << " Weekly Salary of Employee " << i << ": $" << pay << endl; } avg_pay = calcAveragePay(total_pay, num_employees); // Function Call cout << " The Average Weekly Salary for the Company is $" << avg_pay; return 0; } // TODO: add function definitions here 

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!