We want to create a C system that manages the employees of a

We want to create a C++ system that manages the employees of a pharmaceutical company. The company has two types of employees: Researchers and Administrators. Both types of employees have the following properties: employee id (int). name (string), position (string), seniority (int). In addition, researchers have the following attributes: title (string) and area of expertise (string). Administrative employees have the following additional attributes: number of employees that are managed by the employee (int). Create the classes needed to model the employees of the pharmaceutical company. It is up to you to decide how many classes are needed. You must also decide about which functions should be virtual, constant, etc. You need to provide both a class definition and implementation. Each class must have at least the following functions: A default constructor, a regular constructor, a copy constructor, a destructor Accessing functions A print function We want to create a class, called Company, to keep track of the employees defined in Q1. The class Company has the following attributes: name (string) address (string), list of employees (an array of objects of the Employee class), and number of employees the company has (int). Provide the definition and implementation of the class Company. The class must implement the following functions: A default constructor, a regular constructor, a copy constructor, a destructor Accessing functions A function that adds an employee to the company (message should show if the employee already exists) A function that removes an employee from the company (message should show if the employee already exists) A function that returns the number of employees of the company A function that returns the list (names) of the employees A function that prints out the name and address of the company

Solution

#include <iostream>

#include <stdio.h>

using namespace std;

//Base Class - basicInfo

class basicInfo

{

    protected:

        char    name[30];

        int     empId;

        char    gender;

    public:

        void getBasicInfo(void)

        {

            cout << \"Enter Name: \";

            cin.getline(name,30);

            cout << \"Enter Emp. Id: \";

            cin >> empId;

            cout << \"Enter Gender: \";

            cin >> gender;

        }

};

//Base Class - deptInfo

class deptInfo

{

    protected:

        char    deptName[30];

        char    assignedWork[30];

        int     time2complete;

    public:

        void getDeptInfo(void)

        {

            cout << \"Enter Department Name: \";

            cin.ignore(1);

            cin.getline(deptName,30);

            cout << \"Enter assigned work: \";

            fflush(stdin);

            cin.getline(assignedWork,30);

            cout << \"Enter time in hours to complete work: \";

            cin >> time2complete;

        }

};

/*final class (Derived Class)- employee*/

class employee:private basicInfo, private deptInfo

{

    public:

        void getEmployeeInfo(void){

            cout << \"Enter employee\'s basic info: \" << endl;

            //call getBasicInfo() of class basicInfo

            getBasicInfo();     //calling of public member function

            cout << \"Enter employee\'s department info: \" << endl;

            //call getDeptInfo() of class deptInfo

            getDeptInfo();      //calling of public member function

        }

        void printEmployeeInfo(void)

        {

            cout << \"Employee\'s Information is: \"     << endl;

            cout << \"Basic Information...:\"       << endl;

            cout << \"Name: \"      << name   << endl;      //accessing protected data

            cout << \"Employee ID: \" << empId << endl;        //accessing protected data

            cout << \"Gender: \"        << gender << endl << endl;//accessing protected data

             

            cout << \"Department Information...:\" << endl;

            cout << \"Department Name: \"           << deptName   << endl; //accessing protected data

            cout << \"Assigned Work: \"             << assignedWork << endl; //accessing protected data

            cout << \"Time to complete work: \"     << time2complete<< endl; //accessing protected data

        }

};

int main()

{

    //create object of class employee

    employee emp;

     

    emp.getEmployeeInfo();

    emp.printEmployeeInfo();

     

    return 0;

}

 We want to create a C++ system that manages the employees of a pharmaceutical company. The company has two types of employees: Researchers and Administrators.
 We want to create a C++ system that manages the employees of a pharmaceutical company. The company has two types of employees: Researchers and Administrators.
 We want to create a C++ system that manages the employees of a pharmaceutical company. The company has two types of employees: Researchers and Administrators.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site