/* 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];
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:
/* 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
*/
I may need help on writing the other functions, but I want to see if I can do it after I get this one down.
Here is the previous part of the program:
#include<iostream>
#include<iomanip>
using namespace std;
/* TODO: Declare function prototypes during each step.
NOTE: See comments following main() for function specifications
regarding return types, function names, and parameter lists.
*/
void InputEmployeeWage(???????);
void GetTotalWages(double employeeWages[], int);
void GetLargestValue(double employeeWages[], int);
void GetIndexOfSmallest(double employeeWages[], int);
void PrintEmployeeList(int employeeIds[], double employeeWages[], int);
//------------------------------------------------------------------------------
int main()
{
const int MAX_EMP = 5;
int employeeIds[MAX_EMP] = { 1001, 1002, 1003, 1004, 1005 };
double employeeWages[MAX_EMP];
char response;
int count = 0;
do
{
This post has been edited by Reynolds773: 04 December 2012 - 03:17 PM

New Topic/Question
Reply




MultiQuote



|