Employee is a class with a function to set the details of the employee such as the emp_id, Name, Gender and city.The Fulltime Employee is a class derived from Employee has a function to set the Dearness Allowance (DA), House Rent Allowance (HRA) and EPF deduction. Part-time Employee is a class derived from Employee has a function to set the Shift (I,II, or III), Pickup Point, Pickup Time, Drop Point and Leaving Time.The Tech-Staff is a derived class from the Fulltime Employee class. The function set_basic() is to set the basic salary and Pay_Detail() is a function to display the Salary details.
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:
Employee is a class with a function to set the details of the employee such as the emp_id, Name, Gender and city.The Fulltime Employee is a class derived from Employee has a function to set the Dearness Allowance (DA), House Rent Allowance (HRA) and EPF deduction. Part-time Employee is a class derived from Employee has a function to set the Shift (I,II, or III), Pickup Point, Pickup Time, Drop Point and Leaving Time.The Tech-Staff is a derived class from the Fulltime Employee class. The function set_basic() is to set the basic salary and Pay_Detail() is a function to display the Salary details.
Step by step
Solved in 2 steps with 1 images