Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#include #include #include #include #include #include #include #include \"lab_22

ID: 3658883 • Letter: #

Question

#include #include #include #include #include #include #include #include "lab_22_head.h" using namespace std; int main( ) { const int SIZE=100; //list or array size int list[SIZE]; //list or array int value; //tagert value int count; //comparisons of performance metric int pos; //position of the target if found or -1 char choice; //flag for yes or no choice //load list with random numbers loadList(list, SIZE); //show list showList(list, SIZE); //loop to play search again and again do { //get a target value cout<<"Enter a target value to for linear search: "; cin>>value; //linear search pos = linearSearch(list, value, count, SIZE); if (pos == -1) cout<< "The target "<<value <<" is not in the list"<<endl; else cout<< "The target "<<value <<" is in the list at position "<<pos<<endl; cout<<" The number of comparions is " <<count <<endl; //get a choice cout<<"Want to play again (y/n)? => "; cin>>choice; }while (toupper(choice) == 'Y'); ********************************Need help with this part please!!!!******************************************* /****************************************************************** This part is for you: You shall follow the above approaches to implement linear search for a list of words. That is, you need to implement the following three functions: (1) loadWordList(...) (2) linearWordSearch(...) (3) showWordList(...) and have a similar loop to test your implementation. ******************************************************************/ //well done and exit return 0; } #include #include #include #include #include using namespace std; #ifndef LAB_22_HEAD_H #define LAB_22_HEAD_H /*********************************************************************** This function generates SIZE many integers in the range of 0 and 9999 and loads these random integer to the list ***********************************************************************/ void loadList(int list[], const int SIZE) { unsigned seed; //get a random seed cout<<"Enter a random seed => "; cin>>seed; srand(seed); //generate random numbers and load them to the list for (int i=0; i<<"The list is ..... " <<endl; for (int i=0; i<<setw(8)<<right<<list[i]; if ((i+1)==0) cout<<endl; } cout<<endl; } #endif

Explanation / Answer

what is this....what did you actually want??