Question: Note that this lab is built on the in-class exercise that is about designing your own linked list, StudentList. to hold a series of students.
Note that this lab is built on the in-class exercise that is about designing your own linked list, StudentList. to hold a series of students. Each students first name, last name, and grade are saved in a node. Assume the list is in ascending order by students grade. Assume that each student has a unique name.
Provide member functions as explained below** the numerated list of functions.
- Provide a constructor for the class (initialize empty list).
- A member function that appends a student to the list.
void append(string fname, string lname, double grade);
- A member function that inserts a student to the list (ascending order).
void insert(string fname, string lname, double grade);
- A member function that deletes a student from the list.
void deleteNode(string fname, string lname);
- A member function that displays all the students first name, last name and grade in the linked list.
void displayList() const;
- Provide a destructor for the class.
- A member function that searches for a specific student in the list. The function returns true if the specific student is in the linked list. If the student is or is not in the list in your driver program print out a message indicating that the student is or is not found.
bool search(string fname, string lname);
**You must complete and test either the insert() function or the deleteNode() function. You must complete and test append() if you do not choose to complete insert(). You must complete and test search() if you do not choose to complete deleteNode(). You must complete and test the constructor and displayList(). Ideally you would complete ALL these functions as they are all good practice working with linked lists for the test coming up.
Separate your class definition from implementation. Your class definition must be stored in a file called StudentList.h. Your class implementation must be stored in a file called StudentList.cpp.
Design a good driver program
Provide well thought out test driver code or main() test program to test the capabilities of your class. It is your job to demonstrate functionality of your class and member functions in the driver. SHOW through various calls to ALL the functions you wrote that your StudentList class works beautifully. Do not prompt the user for values. Your driver should have all the numbers and information embedded inside the driver to thoroughly show that your StudentList class works. (For example, your class files could then be passed to another programmer who will then use your class in a larger application because now we all know it works through your driver testing it!)
CLEARLY INDICATE WHICH FUNCTIONS ARE TO BE GRADED (SEE EXAMPLE BELOW) in the .h file. If you do not indicate clearly, the first ones read will be the ones graded.
// PLEASE GRADE "INSERT"
// member function documentation: purpose, pre and post conditions.
void insert(string fname, string lname, double grade);
// PLEASE DO NOT GRADE "DELETENODE"
//void deleteNode(string fname, string lname);
Grading
The assignment will be graded in accordance with the Labs and Programming Assignment Expectation handout and the rubric posted on Canvas. Failure to adhere to the guideline could result in losing points.
Submitting your Program
You must submit three files:
- The header file: StudentList.h
- The implementation file: StudentList.cpp
- The driver program: wk6.cpp
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
