Lab 4 - Lists Lab

 Objective

Create a student management system to add, remove, and display students using C++ and the list container.

 Requirements

  1. Define the Student Structure:

    • Create a Student struct with two members: id (integer) and name (string).

    • Implement a constructor for initializing the Student objects.

  2. Create the StudentLab Class:

    • Declare a class StudentLab with a private member students of type list<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.

  3. 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.

  4. 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:

  1. Full source code (.cpp files or .txt files)

  2. Screenshot of the Console with the code executing

2024 - Programming 3 / Data Structures - Author: Dr. Kevin Roark