Question: can solve this in two ways in c++ with header file /implembtetion Question 1: Use the class Employee to complete the following task. Implement Company

can solve this in two ways in c++
with header file /implembtetion  can solve this in two ways in c++ with header file
/implembtetion Question 1: Use the class Employee to complete the following task.
Implement Company class for selling Employees as follows: 1. The member variables:

Question 1: Use the class Employee to complete the following task. Implement Company class for selling Employees as follows: 1. The member variables: - Company id: int. - Company location: string. - number of Employees: int. It is unknown and can vary from one Company to another. - Employees: Employee array, its size is the number of Employees. 2. A Company class constructor that receives: Company number and location. You have to use this pointer. 3. A member function void SetEmployees( Employee *n, int num_of_Employees) which sets the Employees for the Company according to received array of Employees. Note that this function can be used to change the Employees as well. 4. A Destructor for Company Class. 5. copy constructor. 6. A member function Get TotalSalaries which returns the sum of all Employees' salaries in the same Company. 7. A friend function removeEmployee From Company (Company& current Company, int i): this function remove the ith Employee from the array Employees in the currentCompany object and shifts remaining Employees. I should be in a proper range. Note: you have to create new Employee array. 8. A friend function printDetails(Company& e) to print the details of the Company. write a main function consists of the following: 1. create an object of type Company called Companyl. - Company id: 1 - Company location: Amman - number of Employees: 3 - Employees: fill the Employees from the user 2. create an object of type Company called Companylcopy, it is a copy of the object Companyi. Use the copy constructor. 3. call the function removeEmployeeFromCompany to remove the first element in the Employees array of Companyl. 4. call the printDetails function for the two objects. Lab Objectives: Practice dynamic memory allocation and de-allocation. Understand the difference between shallow and deep copy. This pointer. Friend function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!