Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

In C++

Design a program for a coffee shop. Make a menu driven program that allows the user to select items from a menu and add them to an order. Once the user is satisfied with their order, they can output a sales receipt. Display the receipt on the console and save the receipt in a txt file: qbc_sales_receipt.txt. . This coffee shop menu includes

Coffee 1.85
Tea 1.05
Milk 1.25
Donut 2.25
Bagel 2.75

After each item is added to order, display a message for the user indicating the item name and total price (so 2 items at 2.50 each display 5.00)

The program ends when the user prints their sales receipt
The sales receipt should contain:
-Line item for grand total
-Line item for sales tax which is 8%
-Line items with quantity, item name, and item price total
If nothing is ordered, display “No receipt required. Thanks!”

Modular Functions Requirement: main, displayMenu, displaySalesReceipt
Input validation required

The final display should read something like this

Would you like to place an order? (y/n): y

ITEM Price

********************

1. Coffee 1.85

2. Tea    1.05

3. Milk   1.25

4. Donut 2.25

5. Bagel 2.75

********************

Please make a selection: 2

How many Tea would you like: 4

4 of Tea added to order for 4.2

Would you like to continue ordering? (y/n): y

ITEM Price

********************

1. Coffee 1.85

2. Tea    1.05

3. Milk   1.25

4. Donut 2.25

5. Bagel 2.75

********************

Please make a selection: 1

How many Coffee would you like: 3

3 of Coffee added to order for 5.55

Would you like to continue ordering? (y/n): n

SALES RECEIPT

********************

4    Tea $4.2

3    Coffee    $5.55

********************

Subtotal: $9.75

Tax Total:    $0.78

********************

Total:    $10.53

Expert Solution
Check Mark
Still need help?
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

How to turn this code that it accepts string input for the choice of drink instead of using int? 

Solution
Bartleby Expert
by Bartleby Expert
SEE SOLUTION
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

How to turn this code that it accepts string input for the choice of drink instead of using int? 

Solution
Bartleby Expert
by Bartleby Expert
SEE SOLUTION
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education