2. Implement the following classes: Person Employee name: String age: int address: String department: String designation: String constructor accessor mutator */ constructor accessor, mutator */...


2. Implement the following classes:<br>Person<br>Employee<br>name: String<br>age: int<br>address: String<br>department: String<br>designation: String<br>constructor accessor mutator */<br>constructor accessor, mutator */<br>PartTimeEmployee<br>FullTimeEmployee<br>hours: double<br>basic: double<br>rate: double<br>allowance: double<br>* constructor */<br>* accessor-mutator

Extracted text: 2. Implement the following classes: Person Employee name: String age: int address: String department: String designation: String constructor accessor mutator */ constructor accessor, mutator */ PartTimeEmployee FullTimeEmployee hours: double basic: double rate: double allowance: double * constructor */ * accessor-mutator "/ toString */ + salary(): 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 = 18750 %3D

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here