Question: Implement the following classes: Person - name: String - age: int - address: String / * constructor, accessor, mutator * / Employee - department: String

Implement the following classes:
Person
- name: String
- age: int
- address: String
/* constructor, accessor, mutator */
Employee
- department: String
- designation: String
/* constructor, accessor, mutator */
PartTimeEmployee
- hours: double
- rate: double
/* constructor */
/* accessor-mutator */
/* toString */
+ salary(): double
FullTimeEmployee
- basic: double
- allowance: double
/* constructor */
/* accessor-mutator */
/* toString */
+ salary(): double
The relationship is as follows:
Employee extends Person
PartTimeEmployee extends Employee
FullTimeEmployee extends Employee
Create an object for PartTimeEmployee and FullTimeEmployee and print their salary.
For FullTimeEmployee, basic is the base salary, i.e.15000.
Allowance is usually provided as percentage, i.e.25%.
So the total salary of a full time employee =15000+25% of 15000=1875

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!