Accumulating Totals in Single-Level Control Break Programs
In this lab, you will use what you have learned about accumulating totals in a single-level control break program to complete a Java program. The program should produce a report for a supermarket manager to help her keep track of the hours worked by her part-time employees. The report should include the day of the week, the number of hours worked by each employee for each day, and the total hours worked by all employees each day. The report should look similar to the one shown in Figure 7-6.
The student file provided for this lab includes the necessary variable declarations and input and output statements. You need to implement the code that recognizes when a control break should occur. You also need to complete the control break code. Be sure to accumulate the daily totals for all days in the week. Comments in the code tell you where to write your code. You can use the Client By State program in this chapter as a guide for this new program.
1. Open the source code file named SuperMarket.java using Notepad or the text editor of your choice.
2. Study the prewritten code to understand what has already been done.
3. Write the control break code, including the code for the dayChange 0 method, in the main() method.
4. Save this source code file in a directory of your choice, and then make that directory your working directory.
5. Compile the source code file, SuperMarket. java.
6. Execute this program using the following input values:
Monday -6 hours (employee 1), 3 hours (employee 2), 4 hours (employee 3)
Tuesday - 4 hours (employee 1), 2 hours (employee 2)
Wednesday - 2 hours (employee 1), 4 hours (employee 2), 6 hours (employee 3)
Thursday - 4 hours (employee 1)
Friday - 3 hours (employee 1), 4 hours (employee 2), 3 hours (employee 3)
Saturday - 7 hours (employee 1), 7 hours (employee 2), 7 hours (employee 3)
Sunday - 0 hours
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.