Question: 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

 Create a class named Employee that can be used to calculate

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() 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 RM200/month. Managers have a bonus of RM300 /month and clerks have a bonus of RM100/month. Finally create a display method to print the details of the employee. You may assume the initial salary of an employee and other necessary values. Test your classes from a main method. Use the abstract class and methods in your solution

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!