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
accessormutator
toString
salary: double
FullTimeEmployee
basic: double
allowance: double
constructor
accessormutator
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, ie
Allowance is usually provided as percentage, ie
So the total salary of a full time employee of
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
