Question: int searchList ( const int list [ ] , int numElems, int value ) { int index = 0 ; / / Used as a
int searchListconst int list int numElems, int value
int index ; Used as a subscript to search array
int position ; To record position of search value
bool found false; Flag to indicate if the value was found
while index numElems && found
if listindex 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
Gaddis Tony,
Use the code Module Lesson pts Design a copy constructor function for the Employee class. 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. pts Design an add function to add a new employee at the beginning of the list. pts Modify the searchList function Linear Search Algorithm to search an Employee by ID number. 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. pts Test your copy construction function in the driver program. 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
