Write a C++ program that will display a menu consisting of 3 brands of soda, 3 kinds of sandwiches, and 3 kinds of sides. Include the price and the product code. Display it in matrix form (1st column=product, 2nd column=price, 3rd column=code) The program will prompt the user to enter the product code for soda, sandwich and sides. The program will compute the total bill and will display the summary of the orders and the total bill. In case of an invalid code entry, the summary will include a message “You have entered an invalid code for soda/sandwich/sides”, but still the total bill will be computed and displayed.    SPECIFICATIONS: - You may only use the codes that we studied under our lectures - All lines of codes should have a comment.   TEST CASES: The user inputs valid codes Available Products Soda                 Price          Code Coke                  P50              A Royal                 P45              B Sprite                 P45              C   Sandwiches            Price          Code   Hamburger               P65             1 Chicken Burger        P75             2 Footlong                   P80             3   Sides                      Price           Code French Fries            P35              x Apple Pie                 P30              y                  Sundae                    P25              z   Enter valid soda code: A Enter valid sandwich code: 1 Enter valid sides code: x   Result: You have the following order: Coke Hamburger French Fries Your total bill is P150

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question

Write a C++ program that will display a menu consisting of 3 brands of soda, 3 kinds of sandwiches, and 3 kinds of sides. Include the price and the product code. Display it in matrix form (1st column=product, 2nd column=price, 3rd column=code) The program will prompt the user to enter the product code for soda, sandwich and sides. The program will compute the total bill and will display the summary of the orders and the total bill. In case of an invalid code entry, the summary will include a message “You have entered an invalid code for soda/sandwich/sides”, but still the total bill will be computed and displayed.

  

SPECIFICATIONS:

- You may only use the codes that we studied under our lectures

- All lines of codes should have a comment.

 

TEST CASES:

The user inputs valid codes

Available Products

Soda                 Price          Code

Coke                  P50              A

Royal                 P45              B

Sprite                 P45              C

 

Sandwiches            Price          Code  

Hamburger               P65             1

Chicken Burger        P75             2

Footlong                   P80             3

 

Sides                      Price           Code

French Fries            P35              x

Apple Pie                 P30              y                 

Sundae                    P25              z

 

Enter valid soda code: A

Enter valid sandwich code: 1

Enter valid sides code: x

 

Result:

You have the following order:
Coke

Hamburger

French Fries

Your total bill is P150

Expert Solution
steps

Step by step

Solved in 2 steps with 6 images

Blurred answer
Knowledge Booster
Function Arguments
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr