I am doing a lab assignment using arrays. If you read the directions, it says I need to replace both statements with one function. What statements are they referring to? The "if" and "while"? I'm also unsure of what to put in the parameters of the function. It says to put one employeeId in for the parameters, but I am not told to make a variable called employeeId. I only have an array.
/* TODO (STEP 1):
Replace both statements with one function call to
InputEmployeeWage, where the next employee id in
employeeIds array is passed to the function and
the return value is assigned to the corresponding
employee's wage in employeeWages array
*/
cout << "Enter wages for employee "
<< employeeIds[count] << ": ";
cin >> employeeWages[count];
InputEmployeeWage(employeeId);
if( count < MAX_EMP )
{
cout << "\nAnother (y or n): ";
cin >> response;
response = toupper(response);
}
}while(response == 'Y' && count < MAX_EMP);
cout << fixed << showpoint << setprecision(2);
cout << "\n ID Wage" << endl;
Here is how the function is supposed to work:
1 2 3 4 5 6 7 8 9 10 11
/* TODO (STEP 1): Define InputEmployeeWage function
Function to prompt and input wages for one employee.
Parameters:
in: empId
Precondition:
empId is id for employee whose wages will be input
Postcondition:
returns a double value for input wages
*/