COSC 071: Computer Science I
Part II
Fall 2003
- Design and implement a class for storing and manipulating Student
objects (e.g., StudentList).
- The class must implement a linked list using a self-referential class.
The easiest way is to add a pointer to the Student class from Part I;
however, you may also define a new Node class that stores a Student object
and a pointer.
- For the StudentList class, implement methods for
- constructing a list of students,
- printing the list of students (e.g., StudentList::print()),
- adding a new student (e.g., StudentList::add(const Student &s)),
- finding a student by name (e.g., StudentList::find(const string name)),
- removing a student by name (e.g., StudentList::remove(const string name)),
- loading student records from a file
(e.g., StudentList::load(const string filename)),
- saving student records to a file
(e.g., StudentList::save(const string filename)),
- clearing or removing all Student objects from the list
(e.g., StudentList::clear()),
- destructing the list of students.
- Make sure you thoroughly test your class methods.
- Demonstrate your program in one of two ways:
Write a driver program in main that tests the functionality of the
methods of the class StudentList, or write an interactive program
that lets users add, remove, modify, print, load, and save
student records stored in StudentList.