but having trouble figuring out how to write it.
i'm trying to put the running sum in a loop (that's not a while loop) that creates an average pay
with the hours, hourly wage (anything over 40 hours as additional hours at * 1.5) and hours worked.
i'm just having issues working out a loop w/ the accumulator
#include <iostream>
#include <iomanip>
usingnamespace std;
int main()
{
int employees,
hours;
double hourlyWage;
cout << setprecision(2) << fixed;
cout << "How many employees do you have?" << endl;
cin >> employees;
while (employees < 1 || employees > 10)
{
cout << "Please enter a correct amount of employees 1-10" << endl;
cin >> employees;
}
cout << "How many hours do you work?" << endl;
cin >> hours;
cout << "What is the hourly wage?" << endl;
cin >> hourlyWage;I'm thinking these should just be included in the running sum so that it'll ask all employees for that information one by one and take the total after?return 0;
}