Question: int searchList ( const int list [ ] , int numElems, int value ) { int index = 0 ; / / Used as a

int searchList(const int list[], int numElems, int value)
{
int index =0; // Used as a subscript to search array
int position =1; // To record position of search value
bool found = false; // Flag to indicate if the value was found
while (index < numElems && !found)
{
if (list[index]== value)// If the value is found
{
found = true; // Set the flag
position = index; // Record the value's subscript
}
index++; // Go to the next element
}
return position; // Return the position, or 1
}
(Gaddis Tony, 2012)
Use the code Module 2/Lesson 3(2 pts,) Design a copy constructor function for the Employee class.(2 pts.) Modify the driver program and add a menu function that asks the user to select four options: add, delete, search, and quit. Define a list of employees in the drive program.(2 pts.) Design an add function to add a new employee at the beginning of the list.(2 pts.) Modify the searchList function (Linear Search Algorithm) to search an Employee by ID number.(2 pts) Design a remove function to employee search by ID number and swap the last employee stored in the list for the employee to be removed. Otherwise, show the message The employee is not found in the list.(2 pts.) Test your copy construction function in the driver program.(2 pts.) Use almost five employees for your output program. Test each menu option and show the list of employees in each case.

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 Programming Questions!