You
are required to design a software for a company to manage its employees. Given the following requirements:
There are different departments in the company, each department has a name which is unique. Within the department
there are faculty members each having a name, cnic, qualification and salary.
Each department also has staff belonging to it, information to be kept about is their name, cnic, hours worked and hourlyrate
Classes that would be included
1. Department
2. Faculty_members
3. Staff
Relationships of the classes
· The relationship between department class and faculty_members class is aggregation.
· The relationship between department class and staff class is aggregation.
Interfaces
1. Interface of Department class
class Department {
//define data members
private;
string name; //name of department
FacultyMember fac []; //define array containing all faculty members of a department
Staff staff []; //define array containing all staffs of a department
//methods
public:
Department();//Default constructor
Department (string name);/Paramerterized constructor
void setFaculty( FacultyMember f [ ] );
void setStaff ( Staff staff [ ] );
};
2. Interface of Faculty_member class
class FacultyMember {
//define data members
private:
string name;
string cnic;
string qualification;
double salary;
//Methods
public:
FacultyMember(); //default constructor
FacultyMember (string name,string cnic, string qualification, double salary);//parameterized constructor
};
3. Interface of Staff class
class Staff {
//define data members
private:
string name;
string cnic;
int hoursWorked;
double hourlyRate;
//Methods
public:
Staff (); //default constructor
Staff (string name,string cnic, int hoursWorked, double hourlyRate);//parameterized constructor
};
Comments
Leave a comment