Question: Write a complete C++ program that implements the followings: A. The super class Person with the following private data members: 1. Name: Pointer to a

 Write a complete C++ program that implements the followings: A. The

Write a complete C++ program that implements the followings: A. The super class Person with the following private data members: 1. Name: Pointer to a character variable. 2. Address: Pointer to a character variable. 3. Counter: a static integer with initial value 0. The class Person also should include the following public functions: 4. Empty constructor to initialize the private data members as follows: Name ("ANNE"), and Address ("DALLAS"). Also, increase Counter by 1. 5. Parametrized constructor to store the received parameters inside the private data members: Name, and Address. Also, increase Counter by 1. 6. Destructor to delete any pointers. 7. For each data member: Name, Address, and Counter (static) provide an empty member Get function to return the value for each one of those data members. B. The sub class Staff, which inherits public from the class Person, with the following private data members: 1. Salary: Pointer to double variable. 2. Summation: a static double with initial value 0. The class Staff also should include the following public functions: 3. Empty constructor to initialize the private data members as follows: Salary (350.0), and adds to Summation the value of Salary. Also, call the upper class empty constructor. 4. Parametrized constructor to store the received parameters inside the private data member: Salary, and adds to Summation the value of Salary. Also, call the super class parametrized constructor. 5. Destructor to delete any pointers. 6. For each data member: Salary, and Summation (static) provide an empty member Get function to return the value for each one of those data members. C. The main function should include: 1. Definition for two objects of the class Staff: S1, and S2 using the parametrized constructor with any values. 2. Definition for the object of the class Staff: S3 using the empty constructor. 3. Call the Get function from both classes for the three objects: S1, S2, and S3. Print results

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!