Question: Improve upon the Payroll3 class found in Section 14.9 (page 643) of the textbook so that the for loops in the main method dont make

 Improve upon the Payroll3 class found in Section 14.9 (page 643)
of the textbook so that the for loops in the main method
dont make use of int variables (day and date) to keep track
of the day of the week and the day of the month.
Hint: Read up on the Calendar class https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html Its also discussed in
Section 8.15 in the textbook. Instead of paying all the (non-Hourly2) employees
on the 15th and 30th of the month, your modified main method
Improve upon the Payroll3 class found in Section 14.9 (page 643) of the textbook so that the
for loops in the main method dont make use of int variables (day and date) to keep track
of the day of the week and the day of the month.
Hint: Read up on the Calendar class
https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html
Its also discussed in Section 8.15 in the textbook.
Instead of paying all the (non-Hourly2) employees on the 15th and 30th of the month, your
modified main method should pay on the 15th and the last day of the month (i.e. 28th or 29th for
February, 31st for March, 30th for April, etc.)
Additionally, the outer for loop should start from today (i.e. whatever day the program is run)
and loop until the end of the following month. For example, if the program is run on February
25th, the output should show the pay of all the employees in the employees array from
February 25th through March 31st. If the program is run on March 2nd, the output should show the
pay of all the employees in the employees array from March 2nd through April 30th

PayRoll3.java Commission.java SalariedAndCommissioned.java Window Help D) PayRoll3java B) Commissionjava IS SalariedAndCommissionedjava B3.java Commissionjava SalariedAndCommissionedjava Di Commissionedjava ckage HomeworkThree: blic class SalariedAndConmissioned extends Salaried2 implements Commission 1 private double sales; p public SalariedAndCommissioned (String name, double salary) 1 super (name, salary) ; 1/1 end constructor public void addSales (double sales) 1 this.sales + sales; 1/1 end addsales 11 Postcondition: This resets sales to zero. Boverride public double getPay () f double pay = super.getPay () + COMMISSION_RATs + sales; sales =0.0;// reset for next pay period return pay; 1/1 end getray 1// end class SalariedandConmissioned 13.java Commissionjava DSalariedAnndCommissionedjava D Commissionedjava ID E -kage HomeworkThree; public class Commissioned extends Employee2 implements Commission t private double sales =0.0; public Commissioned (String name) (.) super (name) : this. sales = sales: 1 Il end constructor public void addsales (double sales) I this.sales + males; 1// end addsales 1/ Postcondition: This resets sales to zero. Boverride publie double getpay () if double pay = comorssion_RxZ * sales: sa.les: =0.0z xeturn pay: 1. 21 and getpay 1// end class Ccmenissioned Anne: 800.00 (n) PayRoll3.java Commissionjava D) SalariedAndCommissionedjava 1 package HomeworkThree; public abstract class Employee2 private String name: public abstract double getPay () ; public Employee2 (String name) 10 a Conowe x (3) PayRoll3.java D) Commissionjava SalariedAndCommissioned.java Densolt hnna: 800.00 (I) PayRoll3.java []) Commission.java D SalariedAndCommissioned,java (D) Comn

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!