assignment 1:header file
assignment 2: main#3 function
In this assignment, you make significant changes to your linked list coding from Assignment1 S1 Any code module that refers to node will Convert your linode struct from Assignment into a headers need to contain a include for this header file Create a linked list dass named L Place it into the same header file as your struct will contain private data members an node struct variable a linked list header, which is just a pointer variable of typende for node variables Create a second header file for the Student struct Youve already coded dit processing functions-push front.push back thrive front retrieve back and playlist convert the function public member functions of the case assement 1. each function was passed and list header to operate on. Each function which l ed to operate on because ther's header was explicitly passed as a parameter Now that you're using a class 's the dus object used in the call that makes this distinction se passing the header is no longer necessary The constructor for the class should set the linked list header to nullate. There is no destructor Remember that a good programmer always plans his or her debung. If you've coded everything mentioned so far, you've reached a good point to debug Use the main #1 test program see the assignment in Canvas) to make sure everything works before you continue Programming note: Normally, the class member functions would be placed into their own.cpp file, meaning that your project would have a total of three source files: the header file, the.cpp for the class member functions, and a.cpp for main. However, in step 2 [description which follows you're going to template the class, and a requirement for templatised class functions is that they be coded in-line or in the same header file as the class definition. So, for this assignment, code your member functions in-line or within the header file You'll have only two source files the header file, and the.cpp for main I'm looking for evidence of debugging cout's in your program. Leave them in but comment them out so I can see your approach to debugging. Step 2 in assignment 1. the data in each node was of type Student. Now, using a class template, change your struct and class to use any variable type Main 2 has been set up for debugging this step Next, add three functions vold destroy_list deletes each mode in the list, and resets the header to nuotr. The next two functions we not general purpose the previous "General purpose means they are templated and can be used with any data type. These functions are specific to Students, because they reference specific members of that struct bool search_list(int) searches the list for a mode with the given student . Return true found false not bool delete_node (int) deletes the mode which contains the given student ID. If there is more than one nade with the same key, delete mode deletes the first occurrence. Return true if delete successful false the node was not found Main # 3 contains a test program for testing step 3. #include
using namespace std; struct Student string studentName; int studentID; }; struct LLnode LLnode* fwdPtr; Student theData; int list_length (LLnode* node); void display_nodes (LLnode* llh); void push_front (LLnode* & llh, Student s); void push_back (LLnode*& llh, Student s); Student retrieve front (LLnode* llh); Student retrieve_back (LLnode* llh); 112; 112.push front("33333" ); 112.push fronti 22222"); 112.push front "11111"); 112.push back("44444"); 112.push back("55555") 112.push back"66666"); cout using namespace std; struct Student string studentName; int studentID; }; struct LLnode LLnode* fwdPtr; Student theData; int list_length (LLnode* node); void display_nodes (LLnode* llh); void push_front (LLnode* & llh, Student s); void push_back (LLnode*& llh, Student s); Student retrieve front (LLnode* llh); Student retrieve_back (LLnode* llh); 112; 112.push front("33333" ); 112.push fronti 22222"); 112.push front "11111"); 112.push back("44444"); 112.push back("55555") 112.push back"66666"); cout