Create class hourlyemployee that inherits from class


Java

(Creating a New Subclass of Employee) Other types of Employees might include SalariedEmployees who get paid a fixed weekly salary, PieceWorkers who get paid by the number of pieces they produce or HourlyEmployees who get paid an hourly wage with time-and-a-half-1.5 times the hourly wage-for hours worked over 40 hours.

Create class HourlyEmployee that inherits from class Employee and has instance variable hours (a double) that represents the hours worked, instance variable wage (a double) that represents the wages per hour, a constructor that takes as arguments a first name, a lastname, a social security number, an hourly wage and the number of hours worked, set and get methods for manipulating the hours and wage, an earnings method to calculate an HourlyEmployee's earnings based on the hours worked and a toString method that returns the HourlyEmployee's String representation. Method setWage should ensure that wage is nonnegative, and setHours should ensure that the value of hours is between 0 and 168.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Create class hourlyemployee that inherits from class
Reference No:- TGS01721170

Now Priced at $30 (50% Discount)

Recommended (98%)

Rated (4.3/5)