Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1: Write a class named Employee with the following data members and member functions: 1. ID and Age of type integer. 2. Name of

image text in transcribedimage text in transcribedimage text in transcribed

QUESTION 1: Write a class named Employee with the following data members and member functions: 1. ID and Age of type integer. 2. Name of type string. 3. Work hours of type double. 4. Rate of type double, Note that the rate is used to express the payment per hours for example and employee might get paid 20 JDs per hour. The class should have the following member functions: 1. A Default Constructor. 2. A parameterized constructor. 3. A copy constructor. 4. Setters for all data members, note that an employee should be at least 18 years old. 5. Getter for every data member. 6. Print function to print the details of the employee. 7. A functions named Salary that returns double and calculates an employee salary as follows: salary = work hours * Rate QUESTION 2: Write a new class named manager that is derived from Employee class as follows: 1. Department of type string. 2. YearsOfExperience of type integer 3. Bounus of type double. The class should have the following member functions: 1. A default constructor. 2. A parameterized constructor. 3. Print function that prints all the details of the manager. 4. A function named Salary that returns double and calculates the manager's salary as follows: manager salary = employee salary + boynus. QUESTION 3: Write a third class named Executive that is derived from manager. The class has the following member functions: 1. A default constructor. 2. A parameterized constructor. 3. Print function that will print to the screen the string "Executive followed by all of the attributes. 4. A function named Salary that returns double and calculates the Executive's salary as follows: executive salary = manager salary + 25% of manager salary. Hint: you must avoid repeating codes for some of the functions in all classes. QUESTION 4: In main you are required to do the following: 1. Create an object of type Employee using the default constructor. 2. Read from the user all the attributes of an employee. After that, create a new manger object using the parameterized constructor according to the values you read from the user. 3. Create an object of type manager using the default constructor. 4. Read from the user all the attributes of a manger. After that, create a new manger object using the parameterized constructor according to the values you read from the user. 5. Create an object of type Executive using the default constructor. 6. Read from the use all the attributes of an Executive. After that, create a new Executive object using the parameterized constructor according to the values you read from the user. Fill the obiects you created in 1 and 3 from the user 7 QUESTION 3: Write a third class named Executive that is derived from manager. The class has the following member functions: 1. A default constructor. 2. A parameterized constructor. 3. Print function that will print to the screen the string Executive followed by all of the attributes. 4. A function named Salary that returns double and calculates the Executive's salary as follows: executive salary = manager salary + 25% of manager salary. Hint: you must avoid repeating codes for some of the functions in all classes. QUESTION 4: In main you are required to do the following: 1. Create an object of type Employee using the default constructor. 2. Read from the user all the attributes of an employee. After that, create a new manger object using the parameterized constructor according to the values you read from the user. 3. Create an object of type manager using the default constructor. 4. Read from the user all the attributes of a manger. After that, create a new manger object using the parameterized constructor according to the values you read from the user. 5. Create an object of type Executive using the default constructor. 6. Read from the use all the attributes of an Executive. After that, create a new Executive object using the parameterized constructor according to the values you read from the user. 7. Fill the objects you created in 1 and 3 from the user. 8. Print to the screen the salaries of all objects you have created. 9. Print the details of all the objects you have created

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

10. Microsoft Corporation

Answered: 1 week ago

Question

4. EMC Corporation

Answered: 1 week ago