Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have a EmployeeTest and trying to write the Class for it. I want to print out the result: Hours:Mon:10.00 Tue:8.00 Wed:8.00 Thu:8.00 Fri:10.00 Sat:2.00
I have a EmployeeTest and trying to write the Class for it. I want to print out the result: Hours:Mon:10.00 Tue:8.00 Wed:8.00 Thu:8.00 Fri:10.00 Sat:2.00 Sun:2.00. Can anyone help me this? Thank you. the method for setHours is public void setHours(int day,double hours).
private double[] hours
Holds the hours worked on each day of the week.
hours[0] - hours worked on Monday hours[1] - hours worked on Tuesday hours[2] - hours worked on Wednesday hours[3] - hours worked on Thursday hours[4] - hours worked on Friday hours[5] - hours worked on Saturday hours[6] - hours worked on Sunday
// -----------------------code
public class EmployeeTest { testToString(); } public static void testToString() { System.out.println(" -->testToString()"); Employee e; e = new Employee("Bisley", 25.0); e.setHours(0, 10); e.setHours(1, 8); e.setHours(2, 8); e.setHours(3, 8); e.setHours(4, 8); e.setHours(5, 2); e.setHours(6, 2); System.out.println(e); }
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