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
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
Step by step
Solved in 2 steps with 6 images