Simulation of Human Resource Management Gaming Project in C++

Explanation

  1. Class Definitions:
    • Employee Class:
      • Private Members:
        • name: The name of the employee.
        • performance: The performance rating of the employee (0 to 100).
      • Public Methods:
        • Employee(std::string name, int performance): Constructor initializes the employee’s name and performance rating.
        • std::string getName() const: Returns the employee’s name.
        • int getPerformance() const: Returns the employee’s performance rating.
        • void setPerformance(int newPerformance): Sets a new performance rating.
    • HRSystem Class:
      • Private Members:
        • employees: A vector storing Employee objects.
      • Public Methods:
        • void addEmployee(const Employee& employee): Adds an Employee to the system.
        • void evaluatePerformance(): Simulates performance evaluation by randomly changing the performance rating of each employee. The change is between -10 and +10, clamped to a range of 0 to 100.
        • void printEmployees() const: Prints the names and performance ratings of all employees.
  2. main Function:
    • Initializes the random seed with the current time.
    • Creates an HRSystem object and adds several employees.
    • Prints the initial performance of the employees.
    • Simulates performance evaluation over a number of months, updating and printing employee performance after each month.

Leave a Comment

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

Scroll to Top