Student Database Management System Gaming Project in C++

Explanation:

  1. Student Class:
    • Represents a student with name and age.
    • display() const: Displays the student’s details.
  2. StudentDatabase Class:
    • Manages student records using an unordered map (std::unordered_map).
    • addStudent(const std::string& id, const std::string& name, int age): Adds a new student if the ID does not already exist.
    • viewStudent(const std::string& id) const: Displays the details of a student based on their ID.
    • deleteStudent(const std::string& id): Deletes a student record by ID if it exists.
  3. main Function:
    • Demonstrates adding students, viewing their details, deleting a student, and attempting to view the details of a deleted student.

Compilation:

To compile the program, use:

Run the program with:

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top