1) Create a public class named: Employee that would get the firstname and lastname of each
employee from the keyboard/user
2) Create three objects: prog, adm and lib, for programmer, admin and librarian respectively to
access the properties in Employee class.
3) Create EmployeeSalary as parent interface to store basic_sal, housing_all and
transport_all. The values for these three items are fixed for all Employee and has abstract
function calculateSalary.
4) Create three sub classes namely: programmer, admin and librarian to store bonus,
overtime and total salary for each employee
5) Each of the constructor in (4) should inherit the properties of Employee(using the super
keyword) and implement the EmployeeSalary interface.
6) Hide the properties from the parent class Employee using encapsulation principle.
7) Use getters and setters to make the properties in Employee visible and accessible to other
Comments
Leave a comment