Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ CODE PLEASE QUESTION : Write a class named Employee with the following data members and member functions: ID and Age of type integer. Name

C++ CODE PLEASE image text in transcribed
image text in transcribed
QUESTION : Write a class named Employee with the following data members and member functions: ID and Age of type integer. Name of type string Work_hours of type double. 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: A Default Constructor A parameterized constructor. A copy constructor Setters for all data members, note that an employee should be at least 18 years old. Getter for every data member. Print function to print the details of the employee. 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: Department of type string. YearsOfExperience of type integer Bounus of type double The class should have the following member functions: A default constructor. A parameterized constructor. Print function that prints all the details of the manager. - A function named Salary that retums double and calculates the manager's salary as follows: manager salary = employee salary + bounus. QUESTION 3: Write a third class named Executive that is derived from manager. The class has the following member functions: A default constructor 2 A parameterized constructor. Print function that will print to the screen the string "Executive" followed by all of the attributes. A function named Salary that returns double and calculates the Executive's salary as follows: executive salary = manager salary + 25% of manager salary. Hintson must avoid repeating codes for some of the functions in all classes QUESTION 4: In main you are required to do the following: Create an object of type Employee using the default constructor 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. Create an object of type manager using the default constructor 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. Create an object of type Executive using the default constructor 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 objects you created in 1 and 3 from the user. Print to the screen the salaries of all objects you have created. 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

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

What qualities do you see as necessary for your line of work?

Answered: 1 week ago