Lab 4 - Lists Lab
Objective
Create a student management system to add, remove, and display students using C++ and the list
container.
Requirements
Define the Student Structure:
Create a
Student
struct with two members:id
(integer) andname
(string).Implement a constructor for initializing the
Student
objects.
Create the StudentLab Class:
Declare a class
StudentLab
with a private memberstudents
of typelist<Student>
.Implement the following public member functions:
addStudent(int id, const string& name)
: Adds a student to the list.removeStudent(int id)
: Removes a student by ID.displayStudents()
: Displays all the students in the list.
Implement the Main Function:
Create a
StudentLab
object.Add several students using the
addStudent
method.Display the students using the
displayStudents
method.Remove a student using the
removeStudent
method.Display the updated list of students.
Compile and Run:
Compile the program and resolve any errors or warnings.
Run the program and verify that it correctly adds, removes, and displays students.
Deliverable
Upload the following:
Full source code (.cpp files or .txt files)
Screenshot of the Console with the code executing
2024 - Programming 3 / Data Structures - Author: Dr. Kevin Roark