Question
Java Assignment: Write a program that in which you create a super class Employee that encapsulates information about Employees including the hourly wage, hours worked
Java Assignment: Write a program that in which you create a super class Employee that encapsulates information about Employees including the hourly wage, hours worked weekly. Employee class is then used as the basis to create a subclass called FT-Employee ( full time employee) which has toe additional member variables called PTO ( Paid Time Off) and OT ( overtime Hours)
Requirements:
A.) Create a super class Employee that has two member variables, HourlyWage and WeeklyHours, both variables should be defined as private and thus require accessor methods to access them outside the class. The constructor for this superclass should also be defined to initialize the viable. This class also has a member method called calcWeeklyPay which returns the the weekly pay for Employee based on the following formula: HourlyWage * WeeklyHours
B.) Create a subclass FT-Employee (full time employee) which extends Employee with two additional member variables, PTO (paid time off) and OT (over time hours). The constructor should be defined to initialize all variables including the ones defined in the superclass as well as accessor methods to access private members PTO and OT.
C.)
The main program should instantiate 3 objects of type FT-Employee called Admin, Faculty, and Clarical. The following data are used to initialize
Admin: HourlyWage = $50.0, WeeklyHours = 40 hours, PTO = 20 days, OV = 10.0 hours
Faculty: HourlyWage = $45.0, WeeklyHours = 40 hours, PTO = 25 days, OV = 0.0 hours
Clarical: HourlyWage = $15.0, WeeklyHours = 40 hours, PTO = 15 days, OV = 15.0 hours
All over time hours are paid at 1.5 times the HourlyWage
D.)
OUTPUT: Your program should print the following for Admin, Faculty and Staff objects:
The Admin worked XXX hours and has earned $XXX for the week which includes $XXX overtime pay. Admin had XXXX days of paid time off.
Same output for Faculty and Clerical
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