Answer to Question #185392 in C++ for Muhammad Mustafa

Question #185392

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


 


  •  Please decide which classes would be
  • needed and what would be the relationship between those classes.
  •  Write the interface of the classes
1
Expert's answer
2021-04-25T18:41:09-0400

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
     
};

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS