Question: Modify the code to use three linked lists instead of three arrays to hold the employee IDs, hours worked, and wages. When the program starts,

Modify the code to use three linked lists instead of three arrays to hold the employee IDs, hours worked, and wages. When the program starts, it should ask the user to enter the employee IDs. There should be no limit on the number of IDs the user can enter.

Modify the code to use three linked lists instead of three arrays

to hold the employee IDs, hours worked, and wages. When the program

starts, it should ask the user to enter the employee IDs. There

1/ Chapter 7, Programming Challenge 9: Payroll #include #include using namespace std; // Constant for the array size. const int ARRAY_SIZE = 7; // Function Prototypes void getEmployee Info (long [l, int [], double [], double ll, int); void displayWages (long [], double [l, int); int main() { // Array of employee ID numbers long empId [ARRAY_SIZE] { 5658845, 4520125, 7895122, 8777541, 8451277, 1302850, 7580489 }; = // Array to hold the hours worked for each employee int hours (ARRAY_SIZE]; // Array to hold the hourly pay rate for each employee double payRate (ARRAY_SIZE); // Array to hold the gross wages for each employee double wages (ARRAY_SIZE]; // Get the employee payroll information and store // it in the arrays. getEmployee Info (empId, hours, payRate, wages, ARRAY_SIZE); // Display the payroll information. displayWag (empId, wages, ARRAY_SIZE); return 0; } // The getEmployee Info function receives four parallel // arrays as arguments. The 1st array contains employee // IDs to be displayed in prompts. It asks for input and // stores hours worked and pay rate information in the // 2nd and 3rd arrays. This information is used to // calculate gross pay, which it stores in the 4th array. void getEmployee Info (long emp [], int hrs[], double ratell, double payll, int size) cout > hrscount); cin // Validate hours worked. while (hrs > hrscount); } 11 // Get this employee's pay rate. cout > rate [count); // Validate the pay rate. while (rate [count] > rate [count]; } TI // Calculate this employee's gross pay. pay[count] = hrs [count] * rate [count]; } 3 // The displayWages function receives 2 parallel arrays. // The first holds employee IDs and the second holds // employee gross pay. The function displays this // information for each employee. void displayWages (long emp[], double payll, int size) 1 // Set up the numeric output formatting. cout #include using namespace std; // Constant for the array size. const int ARRAY_SIZE = 7; // Function Prototypes void getEmployee Info (long [l, int [], double [], double ll, int); void displayWages (long [], double [l, int); int main() { // Array of employee ID numbers long empId [ARRAY_SIZE] { 5658845, 4520125, 7895122, 8777541, 8451277, 1302850, 7580489 }; = // Array to hold the hours worked for each employee int hours (ARRAY_SIZE]; // Array to hold the hourly pay rate for each employee double payRate (ARRAY_SIZE); // Array to hold the gross wages for each employee double wages (ARRAY_SIZE]; // Get the employee payroll information and store // it in the arrays. getEmployee Info (empId, hours, payRate, wages, ARRAY_SIZE); // Display the payroll information. displayWag (empId, wages, ARRAY_SIZE); return 0; } // The getEmployee Info function receives four parallel // arrays as arguments. The 1st array contains employee // IDs to be displayed in prompts. It asks for input and // stores hours worked and pay rate information in the // 2nd and 3rd arrays. This information is used to // calculate gross pay, which it stores in the 4th array. void getEmployee Info (long emp [], int hrs[], double ratell, double payll, int size) cout > hrscount); cin // Validate hours worked. while (hrs > hrscount); } 11 // Get this employee's pay rate. cout > rate [count); // Validate the pay rate. while (rate [count] > rate [count]; } TI // Calculate this employee's gross pay. pay[count] = hrs [count] * rate [count]; } 3 // The displayWages function receives 2 parallel arrays. // The first holds employee IDs and the second holds // employee gross pay. The function displays this // information for each employee. void displayWages (long emp[], double payll, int size) 1 // Set up the numeric output formatting. cout

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!