Write a program using inheritance to do the following tasks: a) Create an abstract class Employee with the variables id, name and salary. b) Declare an abstract method calculateTax(double) which...


Java


Write a program using inheritance to do the following tasks:<br>a) Create an abstract class Employee with the variables id, name and salary.<br>b) Declare an abstract method calculateTax(double) which calculates the Tax on Salary of an employee.<br>c) Inherit the class Employee into a subclass EmployeeTax. In Employee Tax class do the following tasks:<br>i) Create a method getEmployeeDetails) to read id, name and salary of an employee.<br>ii) Inside the calculateTax() method calculate the tax using the following conditions.<br>Salary<br>Tax<br>>=2000<br>20%<br>>=1500<br>15%<br>>=1000<br>10%<br><1000<br>5%<br>iii) Create a method netsalary0 in the subclass to print the salary.<br>Note: salary=salary-tax<br>

Extracted text: Write a program using inheritance to do the following tasks: a) Create an abstract class Employee with the variables id, name and salary. b) Declare an abstract method calculateTax(double) which calculates the Tax on Salary of an employee. c) Inherit the class Employee into a subclass EmployeeTax. In Employee Tax class do the following tasks: i) Create a method getEmployeeDetails) to read id, name and salary of an employee. ii) Inside the calculateTax() method calculate the tax using the following conditions. Salary Tax >=2000 20% >=1500 15% >=1000 10% <1000 5%="" iii)="" create="" a="" method="" netsalary0="" in="" the="" subclass="" to="" print="" the="" salary.="" note:="" salary="">

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here