Question: Solve this problem using java asap 1. [15 Points) In Onion Garments Ltd, the employees can be divided into two types based on their way

 Solve this problem using java asap 1. [15 Points) In Onion

Solve this problem using java asap

1. [15 Points) In Onion Garments Ltd, the employees can be divided into two types based on their way of earning. The first type of employees gets a fixed monthly salary at the end of each month. The salary is calculated by summing basic salary, 30% of the basic salary as house rent, and 5% of basic salary as medical allowance. Employees can also work on an hourly basis who get a salary depending on the number of hours they work in a month. The salary is calculated by multiplying the hours and hourly pay rate. This rate varies from employee to employee. a. [5 points] Design a class Employee with its attributes and methods including an abstract method calculate Salary() which calculates the salary of each employee and a protected attribute which keeps the salary amount. Design two classes Fixed SalaryEmployee and HourlyRate Employee that inherit the Employee class. The class descriptions are given in the UML diagram below. b. [10 points] The sub-classes have to implement the abstract method calculate Salary(). The toString() method is overridden in the two sub-classes to print the name, mobile number, and salary. FixedSalaryEmployee -basicSalary double Employee #name. String #mobileNum String #salary double HourlyBasisEmployee +calculate Salary double (abstract) toStringo String -perHourRate: double totalHour's double

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!