Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

if answer is correct will directly give thumbs up. copt and paste this code, and do the following changes, using c++ - read all 5

if answer is correct will directly give thumbs up.
copt and paste this code, and do the following changes, using c++
- read all 5 points carefully please
image text in transcribed
Create a class EducationAcademy that has an array of pointers of type Employee, a location of type string and an establishment Date. The previous exercise explains three classes that are fully implemented: Employee, Academic and Administrator. #include using namespace std; class EducationAcademy public: EducationAcademy (int size); // size is number of employees in the EducationAcademy EducationAcademy (int size, string Loc, const Date & D); -EducationAcademy (); void Read Current Staff (); double Get TotalSalaries(); void Print_Current_Staff (); Employee ReadOne Employee(); private: Employee Current_Staff[100); // to allocate a maximum of 100 Employees int no of_Current Staff; // It should not exceed 100 string Location; // default value "PSUT" Date start_Date; // default 1/1/2000 In ReadOneEmployee function the user will have two choices 'A' for Academic and 'B' for Administrator. Based on this choice the user will enter data and allocate an object based on that and return its address. Read_Current_Staff function will use the array of pointers Current_Staff and call ReadOne Employee a number of times based on no_of_Current_Staff. This means that a pointer will be pointing at the object created by ReadOne Employee function. Constructors will initialize the data attributes. Make sure the no_of_Current_Staff does not exceed 100, make it zero if incorrect size was used. Hint: call Read_Current_Staff function. Print_Current_Staff function will print the details of objects allocated by Current_Staff that have salaries between 2000 and 5000 Destructor will deallocate the objects according to the following order. Deallocate all objects with salaries below 1000 , followed by objects with salaries below 2000, and then deallcaote all objects that have salaries above 5000. Then count the number of remaining objects Create a class EducationAcademy that has an array of pointers of type Employee, a location of type string and an establishment Date. The previous exercise explains three classes that are fully implemented: Employee, Academic and Administrator. #include using namespace std; class EducationAcademy public: EducationAcademy (int size); // size is number of employees in the EducationAcademy EducationAcademy (int size, string Loc, const Date & D); -EducationAcademy (); void Read Current Staff (); double Get TotalSalaries(); void Print_Current_Staff (); Employee ReadOne Employee(); private: Employee Current_Staff[100); // to allocate a maximum of 100 Employees int no of_Current Staff; // It should not exceed 100 string Location; // default value "PSUT" Date start_Date; // default 1/1/2000 In ReadOneEmployee function the user will have two choices 'A' for Academic and 'B' for Administrator. Based on this choice the user will enter data and allocate an object based on that and return its address. Read_Current_Staff function will use the array of pointers Current_Staff and call ReadOne Employee a number of times based on no_of_Current_Staff. This means that a pointer will be pointing at the object created by ReadOne Employee function. Constructors will initialize the data attributes. Make sure the no_of_Current_Staff does not exceed 100, make it zero if incorrect size was used. Hint: call Read_Current_Staff function. Print_Current_Staff function will print the details of objects allocated by Current_Staff that have salaries between 2000 and 5000 Destructor will deallocate the objects according to the following order. Deallocate all objects with salaries below 1000 , followed by objects with salaries below 2000, and then deallcaote all objects that have salaries above 5000. Then count the number of remaining objects

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions