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 calculate Tax) method calculate the tax using the following conditions.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question
Java
Instructions:
Add your student id and name as comment in your program.
Copy and paste your solution in the space provided. Also upload your file as an attachment.
Images/pictures of your code is not accepted.
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 Employee Tax. In EmployeeTax class do the following tasks:
i) Create a method getEmployeeDetails) to read id, name and salary of an employee.
i) 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=salary-tax
Transcribed Image Text:Instructions: Add your student id and name as comment in your program. Copy and paste your solution in the space provided. Also upload your file as an attachment. Images/pictures of your code is not accepted. 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 Employee Tax. In EmployeeTax class do the following tasks: i) Create a method getEmployeeDetails) to read id, name and salary of an employee. i) 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=salary-tax
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,