Question: Hi, I need help with coding the SalariedPlusOnCallEmployee class (including all required accessors and mutators). I am trying to revise for my test coming. Please
Hi, I need help with coding theSalariedPlusOnCallEmployeeclass (including all required accessors and mutators). I am trying to revise for my test coming. Please help!
Thanks!


In this week's application shell code a subclass of the SalariedEmployee class called SalariedPlusOnCallEmployee. Instances of this class represent specialist employees that work for a salary but can also be \"called in\" outside of normal working hours to perform critical repairs or tasks. They are the company's most valuable asset. The SalariedPlusOnCallEmployee class includes two instance variables: . workRecords: an ArrayList of WorkRecord instance references for a week 0 You will need to code the WorkRecord class which has three instance variables: - hours (double), dayCode (int) and agreedHourlyRate (double). 0 A WorkRecord is created for a specialist employee each time they are called in and consists of the following: - hours: the duration of the call in (it' 5 double so fractions of hours are allowed) - dayCode: Monday is 1, Tuesday is 2, Sunday is 7 - agreedHourlyRate: this is agreed at the time of the callin o e.g. a typical WorkRecord instance might encode a callin that lasted 0.25 of an hour on Wednesday (dayCode = 3) at a rate of $200.00 per hour. 0 A specialist employee can be called in multiple times in a day and multiple days in a week but is constrained by their schedule for the week (see next). . schedule: a Java array of double. 0 This is an 8 element array of double. The first element is never used. 0 schedu1e[i] records the maximum hours a specialist employee can be called in on the day corresponding to dayCode i. o e.g. the schedule {0.0, 0.0, 0.0, 4.0, 0.0, 0.0, 0.0, 2.0} means the worker is only permitted to be called in for a maximum of 4 hours on Wednesday and 2 hours on Sunday according to this weekly schedule instance. a Code the SalariedPlusOnCallEmployee class (including all required accessors and mutators) 0 You will need a 5parameter constructor - The 4 parameters required for a SalariedEmployee and - a schedule for the week - WorkRecords will be added after construction. The constructor should, however, instantiate an instance of the specialist employee's workRecords ArrayList instance variable during construction 0 Code an addWorkRecord method to add WorkRecord instances to the workRecords ArrayList. See the driver code below for an example of a call a Code a checkWorkRecords method that checks work records for an employee against their schedule and returns false if callin hours exceeds allowed hours in their schedule on any day of the week Log any errors to the console with the specialist employee's name and the dayCode for the day where violation occurred. See the driver code below for an example of a call 0 Code an earnings method that returns their earnings for the week (salary and call ins) 0 Code a toString method. Write as little code as possible - It will probably help to code a scheduleToString method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
