Projects Inventory

Simulation of Database Management System Gaming Project in C++

Explanation

  1. Record Class:
    • The Record class represents a single record in the database. It contains three data members: id
      Advertisement
      , name, and age.
  2. Database Class:
    • The Database class contains a std::vector of Record objects, representing the collection of records in the database.
    • Advertisement
    • The class has the following member functions:
      • addRecord(int id, const std::string &name, int age): Adds a new record to the database.
      • displayRecords() const: Displays all records in the database.
      • searchRecord(int id) const: Searches for a record by its ID and displays it.
      • deleteRecord(int id): Deletes a record from the database by its ID.
  3. Main Function:
    • The main function provides a menu-driven interface for the user to interact with the database.
    • Advertisement
    • The user can add, display, search, and delete records through the menu options.
    • The program continues to run until the user chooses to exit.
Exit mobile version