Save this source code file in a directory of your choice


ACCUMULATING TOTALS IN SINGLE-LEVEL CONTROL BREAK PROGRAMS In this lab, you use what you have learned about accumulating totals in a single-level control break program to complete a C++ program. The program should produce a report for a fast food restaurant owner to help her keep track of hours worked by her part-time employees. The report should include the day of the week and the number of hours worked for each employee for each day of the week, the total hours for the day of the week, and at the end of the week, the total hours worked that week. The report should look similar to the one shown in Figure 8-4.

188_815f1df0-9bbd-4fc9-a59c-0747690ceac3.png

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 function. Be sure to accumulate the daily totals and the grand total for all days in the week. Comments in the code tell you where to write your code. You can use the Bookstore program in this chapter as a guide for this new program.

1. Open the source code file named HoursWorked.cpp 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 in the main function.

4. Write the dayChange control break function.

5. Save this source code file in a directory of your choice and then make that directory your working directory.

6. Compile the source code file HoursWorked.cpp.

7. Execute the program.

Execute this program using the following input values: Monday - 3 hours (employee 1) Tuesday - 4 hours (employee 1) Wednesday - 5 hours (employee 1) Thursday - 5 hours (employee 1) Friday - 3 hours (employee 1), 4 hours (employee 2) Saturday - 7 hours (employee 1), 8 hours (employee 2) Sunday - 0 hours The program results should include: A total of 3 hours worked on Monday. A total of 4 hours worked on Tuesday. A total of 5 hours worked on Wednesday. A total of 5 hours worked on Thursday. A total of 7 hours worked on Friday. A total of 15 hours worked on Saturday. A total of 0 hours worked on Sunday. A grand total of 39 hours worked for the week.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Save this source code file in a directory of your choice
Reference No:- TGS02194077

Expected delivery within 24 Hours