Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in JAVA please. will upvote if code is properly written! Task: Create a class named Employee that can be used to calculate the salaries of
in JAVA please. will upvote if code is properly written!
Task: Create a class named Employee that can be used to calculate the salaries of different employees. The Employee class should keep a track of the employee ID, name, department, salary, and designation with appropriate accessor and mutator methods. Also create an equals () method that overrides Object's equals 0 method, where employees can check if their designation is identical. Next, create two additional classes named Manager and Clerk that are derived from Employee. Create an overridden method named addBonus that returns the salary of the employee after adding up the bonus. There is a default bonus of $200/ month. Managers have a bonus of $300/ month and clerks have a bonus of $100/ month. Finally, create a display method to print the details of the employee. Test your classes from the main method. You may assume the initial salary of an employee and other necessary values. Now, extend this to calculate the salary deductions based on the number of days an employee is on leave. Consider 20 working days per month. Add an overridden method that calculates the deductions of each employee based on their leave record. In your main method, create an array deduction (of type integer), filled with sample data of all types of Employees. Finally, calculate the total deduction that iterates through the array and returns the total amount of deductions of all the employees in a month. The following picture shows the sample console output after the execution of the main program Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started