Assignment No.
3
Title: Inheritance
Aim: Design and develop inheritance for a given case study, identify objects and relationships and implement
inheritance wherever applicable. Employee class with Emp_name, Emp_id, Address, Mail_id, and Mobile_no as
members. Inherit the classes, Programmer, Team Lead, Assistant Project Manager and Project Manager from
employee class. Add Basic Pay (BP) as the member of all the inherited classes with 97% of BP as DA, 10 % of BP as
HRA, 12% of BP as PF, 0.1% of BP for staff club fund. Generate pay slips for the employees with their gross and net
salary.
Objectives: 1) To Study Inheritance and its types
2) To implement inheritance using OOP language
Theory:
1)What is Inheritance?
2) Example(sample Code showing syntax of java inheritance using extends keyword )
3) What is IS-A relationship
4) What is HAS-A Relationship
5)Explain Types of Inheritance
(Answer the above questions with examples)
Input:
Empid, address, mailid, mobileno, Basic Pay (BP)
Output:
Gross_salary and Net_salary slip
Conclusion:
Write the algorithm and draw the flowchart.