Question
// SuperMarket.cpp - This program creates a report that lists weekly hours worked 
// by employees of a supermarket. The report lists total hours for 
// each day of one week. 
// Input:  Interactive
// Output: Report. 

#include <iostream>
#include <string>
using namespace std;
int main() 
{
   // Declare variables.
   const string HEAD1 = "WEEKLY HOURS WORKED";
   const string DAY_FOOTER = "                                Day Total ";
   // Leading spaces in DAY_FOOTER are intentional.
   const string SENTINEL = "done";            // Named constant for sentinel value. 
   double hoursWorked = 0;                  // Current record hours.
   string dayOfWeek;                      // Current record day of week.
   double hoursTotal = 0;                         // Hours total for a day.
   string prevDay = "";           // Previous day of week.
   bool notDone = true;               // loop control
  
   // Print two blank lines.
   cout << endl << endl; 
   // Print heading.
   cout << "\t\t\t\t\t" << HEAD1 << endl;
   // Print two blank lines.
   cout << endl << endl;  

   // Read first record 
   cout << "Enter day of week or done to quit: ";
   cin >> dayOfWeek;
   if(dayOfWeek  == SENTINEL)
      notDone = false;
   else
   {
      cout << "Enter hours worked: ";
      cin >> hoursWorked;
      prevDay = dayOfWeek;
   }     
    
   while(notDone == true)
   {  
      // Implement control break logic here
      // Include work done in the dayChange() function
   }
   cout << "\t\t" << DAY_FOOTER << hoursTotal << endl;
          
   return 0;

} // End of main() 
Expand
Expand

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Programing Language

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Binary Search algorithm has an element given in sequential arrays. We have seen that at the O (logN)...

A: Objective of the question:- To write the pseudo-code of the binary search algorithm if there are mul...

Q: Problem 5 ( Suppose that your hash function resolves collisions using open addressing with double ha...

A: The, answer has given below;

Q: P.S:  See image for question.

A: NOTE : pow() function is used to calculate the power of numbers   #include &lt;iostream&gt;#include&...

Q: You are to program an open addressing hash table. Use array size to be 50.Your hash table must resol...

A: Hashing is an improvement over Direct Access Table. The idea is to use a hash function that converts...

Q: Identify the contents of the registers, memory location (C070H), and the flags as the following inst...

A: Given: M=C070 H Now solve the problem: LXI H, 2020H : (load register pair immediately) After executi...

Q: Were locations A-M adequate, or did you need a larger sample to find the patterns?

A: Yes

Q: (Airplane Seating Assignment) | Write a program that can be used to assign seats for a commercial ai...

A: #include&lt;iostream&gt; #include&lt;cctype&gt; #include&lt;iomanip&gt; using namespace std; void ge...

Q: Write a C program, called msg.c, that reads messages from an input file (or stdin) and verifies whet...

A: Actually, program is a executable software that runs on a computer. 

Q: Implement the below class. Car- plateNumber: String- horsePower: int- year: int- nbCarsCreated: int+...

A: The required Java code is given below: public class Car {                      // class Car definiti...

Q: What type of device are you attempting to synchronize? What programs and apps are available to synch...

A: A big part of this is connecting your smartphone to your PC. Not only does this let you seamlessly m...

Q: What is a computer virus? What is a worm?

A: VIRUS stands for Vital Infection Resources Under Sieze A computer virus, much like a flu virus, is d...

Q: Q3: Convert the following while loop into a do-while loop. int number; int sum = 0; count&lt;&lt; "E...

A: Click to see the answer

Q: Convert the given CFG to CNF: a) E-> E+T | T, T-> T*F | F, F -> 0 | 1 | (E) o where the set of termi...

A: X-&gt;+ Y-&gt;* Z-&gt;( P-&gt;) E0-&gt;ST|RF|0|1|QPE-&gt;ST|RF|0|1|QPT-&gt;RF|0|1|QPF-&gt;0|1|QPQ-&g...

Q: # phyton A vector contains the grades obtained by students of a class in an assessment, with the fol...

A: import numpy as np list = input().split() list = [int(i) for i in list] grades = np.array(list)names...

Q: void fun1() { float a; void fun2() { int b, c; <-- 1 The calling sequence for this program for execu...

A: Actually, function is a group of statements.

Q: 6- Please I want solution of this question. Thanks

A: Given expression: - / * 6 + * 4 y 7 3 x Substitute the values “A”, and “B” to “x”, and “y” respectiv...

Q: i) Common Vulnerabilities of Fedora OS (FIVE (5) vulnerabilities).ii) Tools/techniques used to asses...

A: Note: In the question there is multiple parts. According to the guidelines you will get the answers ...

Q: Write a program that reads repeatedly from the keyboard a prefix expression, converts it to a fully ...

A: Since you did not mention the language iam providing the answer in java Code: import java.util.*;   ...

Q: In Python:  So this is part of a large project I am working on but I'm having a hard time finding ou...

A: The ask is to build the study hours application by doing the following: - read the student details f...

Q: Write a Java or C++ program that will display the given menu: A Simple Library System1. Add a Studen...

A: Actually, java is a object oriented programming language. It is a platform independent.

Q: Prepare a "Functionality Requirement Analysis" document which informs technical people about require...

A: Solution: Requirement Analysis can be stated as the process of  defining user expectations to build ...

Q: u can consider graph as describe question .consider as ur own by given question description

A: The Bellman-Ford algorithm maybe thanks to finding single-source shortest paths during a graph withn...

Q: How should i use github?What are the best hacking apps for Android?Can I earn through canva and remo...

A: GitHub GitHub is a highly used software that is typically used for version control. It is helpful wh...

Q: Search online for samples of IT contracts. Use search phrases like “IT contract” or “sample contract...

A: The, given information is: Search online for samples of IT contracts. Use search phrases like “IT co...

Q: code is to be written in C A palindrome is a word that reads the same forward and backwards. For exa...

A: Introduction of the Program: The C program creates char type arrays that stores string and the progr...

Q: The IT director of Global Hills started the meeting today by saying "I've got some good news and som...

A:   Solution 1:  Some of the drawbacks related to device growth are:  By the end of November, which i...

Q: Code in C# (OOP Concept) Do a program that does the following: Ask for a number from the user in the...

A: Step 1:-   The first program in the C# programming language and the second program in the C++ progra...

Q: Design a class named Rectangle to represent a rectangle. The class contains: Two double data fields...

A: public class Main{ public static void main(String[] args) {    //create Rectangle using no arg const...

Q: This is the question -  Write an application that throws and catches an ArithmeticException when you...

A: Answer: 1) take an integer input from the user  2) if the input number is positive then print the sq...

Q: Evaluate the following statement: In JavaScript array you can store only integers, double and Boolea...

A: In JavaScript array, one can store not only integers, double and Boolean values but also string valu...

Q: Assume that bit P2.2 is used to control an outdoor light and bit P2.5 a light inside a building. Sho...

A: PROGRAM:   SETB C                   ; CY = 1 ORL C,P2.2            ; CY = P2.2 OR CY MOV P2.2,C     ...

Q: What is the significance of empowerment technologies?

A: Empowerment Technology -  Empowerment of technologies ia very important because it make the work of ...

Q: Write A Program In C  The Example :  #include&lt;stdio.h&gt; #include&lt;ctype.h&gt; #define MONTHS_...

A: Program: #include&lt;stdio.h&gt; #include&lt;ctype.h&gt; #define MONTHS_SIZE 12 #define DAYS_SIZE 7 ...

Q: what is the pseudocode and flowchart

A: you have to define both the method in the Class and then take input and return the output as a full ...

Q: (Given 11/24/20 Homework #4 Due: 12/10/20) Following is a data description of a library: The library...

A: Actually, database is used to stores the data.

Q: Q1 - Draw flow graph online shopping application : • Declaration of variables• Valid input statement...

A: FLOWCHART OF ONLINE SHOPPING APPLICATION:

Q: This is an object oriented programming question The code should be in C++ laanguage. give any exampl...

A: A constructor is invoked whenever a class instance is created in a program. The constructor takes th...