ccumulating Totals in Single-Level Control Break Programs in C++ p| Accumulating Totals in Single-Level Control SuperMarket.cpp 1 // SuperMarket.cpp - This program creates a report that lists weekly hours worked 2 // by employees of a supermarket. The report lists total hours for 3 // each day of one week. 4 // Input: Interactive 5 // Output: Report. Break Programs Summary 6. In this lab, you will use what you have learned about accumulating totals in 7 #include a single-level control break program to complete a C++ program. The 8 #include 9 using namespace std; 10 int main() 11 { // Declare variables. const string HEAD1 = "WEEKLY HOURS WORKED"; 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 and the total hours worked by all employees each day. 12 13 const string DAY_FOOTER =" // Leading spaces in DAY FOOTER are intentional. const string SENTINEL = "done"; 14 Day Total "; The student file provided for this lab includes the necessary variable 15 declarations and input and output statements. You need to implement the // Named constant for sentinel value. // Current record hours. // Current record day of week. // Hours total for a day. 16 code that recognizes when a control break should occur. You also need to 17 double hoursWorked = 0; complete the control break code. Be sure to accumulate the daily totals for 18 string dayofWeek; double hoursTotal = 0; 19 all days in the week. Comments in the code tll you where to write your string prevDay = ""; bool notDone = true; // Previous day of week. // loop control 20 code. 21 22 Instructions // Print two blank lines. cout << endl « endl; // Print heading. 23 24 25 1. Study the prewritten code to understand what has already been done. 26 cout « "\t\t\t\t\t" << HEAD1 <« endl; 2. Write the control break code, including the code for the dayChange(). // Print two blank lines. 27 function, in the main() function. 28 cout « endl « endl; 29 // Read first record cout <« "Enter day of week or done to quit: "; cin >> dayof Week; if(dayofWeek == SENTINEL) notDone = false; 3. Execute the program by clicking the Run button at the bottom of the 30 31 screen. Use the following input values: 32 Monday-6 hours (omployoe 1) 33 Tuesday-2 hours (employee 1). 3 hours (employee 2) 34 35 { else Wednesday-5 hours (employee 1). 3 hours (employee 2) 36 Thursday-6 hours (employee 1) Friday-3 hours (employeo 1). 5 hours (employee 2)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Help! Thank you.

* MindTap - Cengage Learning
8 https://ng.cengage.com/static/nb/ui/evo/index.html?deploymentld=5992722366307456066370989340&elSBN=9780357430583&id=D1344324818&snapshotld=2685346&
CENGAGE MINDTAP
Q Search this course
Accumulating Totals in Single-Level Control Break Programs in C++
Accumulating Totals in Single-Level Control
SuperMarket.cpp
+
>- Terminal
+
1 // SuperMarket.cpp - This program creates a report that lists weekly hours worked
2 // by employees of a supermarket. The report lists total hours for
3 // each day of one week.
4 |/ Input:
5 // Output: Report.
Break Programs
A-Z
Summary
Interactive
</>
In this lab, you will use what you have learned about accumulating totals in
7 #include <iostream>
a single-level control break program to complete a C++ program. The
8 #include <string>
9 using namespace std;
10 int main()
11 {
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 and the total hours worked by all
employees each day.
12
// Declare variables.
13
const string HEAD1 = "WEEKLY HOURS WORKED";
14
const string DAY_FOOTER ="
Day Total ";
The student file provided for this lab includes the necessary variable
15
// Leading spaces in DAY_FOOTER are intentional.
declarations and input and output statements. You need to implement the
// Named constant for sentinel value.
// Current record hours.
// Current record day of week.
// Hours total for a day.
16
const string SENTINEL = "done";
code that recognizes when a control break should occur. You also need to
17
double hoursWorked = 0;
complete the control break code. Be sure to accumulate the daily totals for
18
string dayofWeek;
all days in the week. Comments in the code tell you where to write your
19
double hoursTotal = 0;
// Previous day of week.
// loop control
20
string prevDay = "";
bool notDone = true;
code.
21
22
Instructions
23
// Print two blank lines.
24
cout <« endl << endl;
1. Study the prewritten code to understand what has already been done.
// Print heading.
25
26
cout <« "\t\t\t\t\t" « HEAD1 <« endl;
2. Write the control break code, including the code for the dayChange()
27
// Print two blank lines.
function, in the main() function.
28
cout <« endl <« endl;
29
3. Execute the program by clicking the Run button at the bottom of the
30
// Read first record
31
cout <« "Enter day of week or done to quit: ";
cin >> dayofWeek;
if(dayofWeek
notDone = false;
screen. Use the following input values:
32
Monday-6 hours (employee 1)
ESENTΙNEL)
33
Tuesday-2 hours (employee 1), 3 hours (employee 2)
34
35
else
Wednesday-5 hours (employee 1), 3 hours (employee 2)
36
{
Thursday-6 hours (employee 1)
Friday-3 hours (employee 1), 5 hours (employee 2)
DEV
7:08 PM
12/14/2021
Ip
Transcribed Image Text:* MindTap - Cengage Learning 8 https://ng.cengage.com/static/nb/ui/evo/index.html?deploymentld=5992722366307456066370989340&elSBN=9780357430583&id=D1344324818&snapshotld=2685346& CENGAGE MINDTAP Q Search this course Accumulating Totals in Single-Level Control Break Programs in C++ Accumulating Totals in Single-Level Control SuperMarket.cpp + >- Terminal + 1 // SuperMarket.cpp - This program creates a report that lists weekly hours worked 2 // by employees of a supermarket. The report lists total hours for 3 // each day of one week. 4 |/ Input: 5 // Output: Report. Break Programs A-Z Summary Interactive </> In this lab, you will use what you have learned about accumulating totals in 7 #include <iostream> a single-level control break program to complete a C++ program. The 8 #include <string> 9 using namespace std; 10 int main() 11 { 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 and the total hours worked by all employees each day. 12 // Declare variables. 13 const string HEAD1 = "WEEKLY HOURS WORKED"; 14 const string DAY_FOOTER =" Day Total "; The student file provided for this lab includes the necessary variable 15 // Leading spaces in DAY_FOOTER are intentional. declarations and input and output statements. You need to implement the // Named constant for sentinel value. // Current record hours. // Current record day of week. // Hours total for a day. 16 const string SENTINEL = "done"; code that recognizes when a control break should occur. You also need to 17 double hoursWorked = 0; complete the control break code. Be sure to accumulate the daily totals for 18 string dayofWeek; all days in the week. Comments in the code tell you where to write your 19 double hoursTotal = 0; // Previous day of week. // loop control 20 string prevDay = ""; bool notDone = true; code. 21 22 Instructions 23 // Print two blank lines. 24 cout <« endl << endl; 1. Study the prewritten code to understand what has already been done. // Print heading. 25 26 cout <« "\t\t\t\t\t" « HEAD1 <« endl; 2. Write the control break code, including the code for the dayChange() 27 // Print two blank lines. function, in the main() function. 28 cout <« endl <« endl; 29 3. Execute the program by clicking the Run button at the bottom of the 30 // Read first record 31 cout <« "Enter day of week or done to quit: "; cin >> dayofWeek; if(dayofWeek notDone = false; screen. Use the following input values: 32 Monday-6 hours (employee 1) ESENTΙNEL) 33 Tuesday-2 hours (employee 1), 3 hours (employee 2) 34 35 else Wednesday-5 hours (employee 1), 3 hours (employee 2) 36 { Thursday-6 hours (employee 1) Friday-3 hours (employee 1), 5 hours (employee 2) DEV 7:08 PM 12/14/2021 Ip
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Introduction to Coding
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education