An organization has two types of employees: regular and adhoc. Regular employees get a salary which is basic + DA + HRA where DA is 10% of basic and HRA is 30% of basic. Adhoc employees are daily wagers who get a salary which is equal to Number * Wage 1) Define the classes shown in the following class hierarchy diagram: Employee name salary () Regular Adhoc wage urmber days (int n) ealary ) Basic salary ()

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.4: Class Inheritance And Polymorphism
Problem 2E
icon
Related questions
Question
An organization has two types of employees: regular and adhoc. Regular
employees get a salary which is basic + DA + HRA where DA is 10% of basic and
HRA is 30% of basic. Adhoc employees are daily wagers who get a salary which is
equal to Number * Wage
(i) Define the classes shown in the following class hierarchy diagram:
Employee
name
eno
salary ()
Regular
Adhoc
wage
пnber
days (int n)
salary O
Basic
salary ()
Transcribed Image Text:An organization has two types of employees: regular and adhoc. Regular employees get a salary which is basic + DA + HRA where DA is 10% of basic and HRA is 30% of basic. Adhoc employees are daily wagers who get a salary which is equal to Number * Wage (i) Define the classes shown in the following class hierarchy diagram: Employee name eno salary () Regular Adhoc wage пnber days (int n) salary O Basic salary ()
(ii) Define the constructors. When a regular employee is created, parameter. basic
must be a parameter
When adhoc employee is created wage must be a parameter.
(iii) Define the destructors.
(iv) Define the member functions for each class. The member function days ( )
updates number of the Adhoc employee.
(v) Write a test program to test the classes.
Transcribed Image Text:(ii) Define the constructors. When a regular employee is created, parameter. basic must be a parameter When adhoc employee is created wage must be a parameter. (iii) Define the destructors. (iv) Define the member functions for each class. The member function days ( ) updates number of the Adhoc employee. (v) Write a test program to test the classes.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning