C++(OOP) Write a program that implements the following situation. A marketing organization ABC Ltd helps to promote the sales of other brands and products. ABC Ltd has permanent employees and also hires employees from outside as well for different occasions on contract basis. A permanent employee gets monthly salary whereas contractual employee gets paid on daily wage rate along with basic salary. You need to create a class Employee with following data members. • String name • Int age • Int contact • Int CNIC • String education You will inherit the Employee class into Permanent_EMP and Contractual_EMP classes. In Permanent_EMP you are required to create following data members • Int basic_salary • Int allowances In addition, you are required to write down following class functions • A constructor that takes values of salary & allowances at the time of object declaration. • A method that calculates and returns the salary with following formula o Salary = basic_salary + allowances. In Contractual_EMP class you are required to create following data members • Int basic_salary • Int commission_percentage In addition, you are required to write down following class functions • A constructor that takes values of basic_salary & commission_percentage at the time of object declaration. • A method that calculates and returns the salary with following formula o Salary = basic_salary + (basic_salary* commission_percentage/100) In main you are required to create one object of Permanent_EMP and one object of Contractual_EMP and implement the above given concept by using dynamic polymorphism.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.2: Providing Class Conversion Capabilities
Problem 6E
icon
Related questions
Question

C++(OOP)
Write a program that implements the following situation.
A marketing organization ABC Ltd helps to promote the sales of other brands and products. ABC
Ltd has permanent employees and also hires employees from outside as well for different occasions
on contract basis. A permanent employee gets monthly salary whereas contractual employee gets
paid on daily wage rate along with basic salary.
You need to create a class Employee with following data members.
• String name
• Int age
• Int contact
• Int CNIC
• String education
You will inherit the Employee class into Permanent_EMP and Contractual_EMP classes.
In Permanent_EMP you are required to create following data members
• Int basic_salary
• Int allowances
In addition, you are required to write down following class functions
• A constructor that takes values of salary & allowances at the time of object declaration.
• A method that calculates and returns the salary with following formula
o Salary = basic_salary + allowances.
In Contractual_EMP class you are required to create following data members
• Int basic_salary
• Int commission_percentage
In addition, you are required to write down following class functions
• A constructor that takes values of basic_salary & commission_percentage at the time of
object declaration.
• A method that calculates and returns the salary with following formula
o Salary = basic_salary + (basic_salary* commission_percentage/100)
In main you are required to create one object of Permanent_EMP and one object of
Contractual_EMP and implement the above given concept by using dynamic polymorphism.

Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
User Defined DataType
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning