2. Create a class named 'Member' having the following members: Data members 1 - Name 2 - Age 3 - Phone number 4 - Address 5 - Salary It also has a method named 'printSalary' which prints the salary of...


2. Create a class named 'Member' having the following members:<br>Data members<br>1 - Name<br>2 - Age<br>3 - Phone number<br>4 - Address<br>5 - Salary<br>It also has a method named 'printSalary' which prints the salary of the members.<br>Two classes 'Employee' and 'Manager' inherits the 'Member' class. The 'Employee' and<br>'Manager' classes have data members 'specialization' and 'department' respectively. Now,<br>assign name, age, phone number, address and salary to an employee and a manager by<br>making an object of both of these classes and print the same.<br>

Extracted text: 2. Create a class named 'Member' having the following members: Data members 1 - Name 2 - Age 3 - Phone number 4 - Address 5 - Salary It also has a method named 'printSalary' which prints the salary of the members. Two classes 'Employee' and 'Manager' inherits the 'Member' class. The 'Employee' and 'Manager' classes have data members 'specialization' and 'department' respectively. Now, assign name, age, phone number, address and salary to an employee and a manager by making an object of both of these classes and print the same.

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here