Question: i am looking for java. You will write a class named Employee that keeps track of the hours worked on each day of the week.

i am looking for java.
You will write a class named Employee that keeps track of the hours worked on each day of the week. The class will have the following members: a. hours - a double array with 7 elements. This holds the hours worked on each day of the week. Monday (index = 0) is the first day of the week. b. Employee - constructor that accepts a name for the employee and their pay rate (S/hr). c. getHours(i: int) - returns the number of hours worked on day i. d. setHours(i: int, num: double) - sets the number of hours worked on day e. get Name- returns the name f. getPayRate - returns the pay rate g. getNumDays Worked - returns the number of days worked. h. getTotalhours - returns the total number of hours worked for the week i. getWeekdayHours - returns the total number of hours worked during days (Mon-Fri) j. getWeekendHours - returns the total number of hours worked during the weekend (Sat-Sun) k. newWeek- starts the week over with no hours on any day. l. getPay - returns the total pay for the week computed in the following way: Weekday hours are paid at the pay rate. Any hours over 40 during weekdays are paid at time-and-a-half. Weekend hours are paid at double-time, no matter whether the workday hours exceeds 40. Working 7 consecutive day earns a bonus of $50.00, no matter how many total hours worked. m. mergeEmployee - accepts an Employee object and merges the hours. You can assume the input employee has the same name and pay rate. For example if e1 had hours: [8, 8, 8, 2, 0, 0, 0] and e2 had hours: [0, 0, 0, 4, 10, 0, 0]. Then, when is excecuted, the el will have hours: [8, 8, 8, 6, 10, 0, 0]. n. toString - returns a string that is formatted like this: Pay Stub, Name: Waldo, Pay Rate $25.00, Hours: Mon: 8.90 Tue: 8.00 Wed: 8.00 Thu: 8.00 Fri: 10.00 Sat: 2.00 Sun: 2.00 Days worked: 7 Total Hours: 46.00, Weekday hours: 42.00, Weekend hours: 4.00, Total pay: $1325.00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
