design a structure for the emplyee/manager system. An employee belongs to a manager. A manager has several employees. They may also belong to a manager. Design the structure so that it supports the following operation: delete an employee/manager, promotion(an employee becomes a manager).
// the following design is not done yet. Just an initial thought
class People {
protected:
string name;
unsigned int age;
string title;
public:
People();
virtual ~People();
};
class Manager : public People {
private:
vector<Employee*> emp;
Manager* mngr;
public:
void enhance_moral();
};
class Employee : public People {
private:
Manager* mngr;
public:
void work();
};
class Sys {
private:
vector<Manager*> managers;
vector<Employee*> employees;
public:
void fire_people(People& p);
void promote_employee(const Employee& e);
};