This code should include a while loop that allows the user to continue entering employees as long as they want to continue:
int main()
{
Real payrate,hours, gross,again;
cout << "Enter the employees hourly pay rate. \n";
cin >> payrate;
cout<< "Enter the total hours worked by employee. \n";
cin >> hours;
while (payrate > 18.25 || payrate < 7.50)
{
cout << "The valid value for pay rate is in the range. \n";
cout << " of $7.50 through $ 18.25. \n";
cout << "Enter a valid value for pay rate. \n";
cin >> payrate;
}
while (hours > 40 || hours < 0)
{
cout << "Please enter hours worked between 0 and 40. \n ";
cin >> hours;
}
gross = payrate * hours;
cout << "The gross pay of the employee is $ " << gross << endl;
}