ery employee in a firm XYZ has attributes employeeid, name and salary. However the sales employees in firm XYZ has all the attributes of employees and also has an additional attribute named bonus. You are a software developer who has to the implement the relation between employee and sales employee. Write the code for classes employee and employee_sales. Write the constructors for both classes that set the attributes of both classes.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Every employee in a firm XYZ has attributes employeeid, name and salary.
However the sales employees in firm XYZ has all the attributes of employees and also has an additional attribute named bonus.
You are a software developer who has to the implement the relation between employee and sales employee.
Write the code for classes employee and employee_sales. Write the constructors for both classes that set the attributes of both classes.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 1 images