Write a lunch order program which allows to select lunch items according to the lunch menu provided below. (B) Burger with French Fries – 8.99 (C) Chicken and Rice – 9.50 (T) Tuna Sandwich – 10.49 (E) Exit a) Write a function void takeOrder(int& burger, int& chicken, int& tuna); which will display the menu item, validate the entries and count how many orders for each menu item: - Request one character for a lunch item. Menu options must be case insensitive (i.e. ‘E’ and ‘e’ must work). - Validate the input value. - Handle the menu (with a switch statement) to record how many orders for each item is taken. - The function must use pass by reference parameters to return how many orders for each menu item. - End the function only if Exit option is selected. b) Write a function payOrder(int burger, int chicken, int tuna) to print out how many orders are taken for each menu and calculate the total price. c) Call the functions in main() as follows - int main() { int burger=0; int chicken=0; int tuna=0; takeOrder(burger,chicken,tuna); payOrder(burger,chicken,tuna); return 0; }
USE C++
ONLY <IOSTREAM>
THANK YOU
2. Write a lunch order program which allows to select lunch items according
to the lunch menu provided below.
(B) Burger with French Fries – 8.99
(C) Chicken and Rice – 9.50
(T) Tuna Sandwich – 10.49
(E) Exit
a) Write a function void takeOrder(int& burger, int& chicken, int& tuna);
which will display the menu item, validate the entries and count how many
orders for each menu item:
- Request one character for a lunch item.
Menu options must be case insensitive (i.e. ‘E’ and ‘e’ must work).
- Validate the input value.
- Handle the menu (with a switch statement) to record how many orders for
each item is taken.
- The function must use pass by reference parameters to return how many
orders for each menu item.
- End the function only if Exit option is selected.
b) Write a function payOrder(int burger, int chicken, int tuna) to print out
how many orders are taken for each menu and calculate the total price.
c) Call the functions in main() as follows -
int main() {
int burger=0; int chicken=0; int tuna=0;
takeOrder(burger,chicken,tuna);
payOrder(burger,chicken,tuna);
return 0;
}
![Example Output
| G:\ETS75project\LunchMenu.exe
Select an opt ion_from the lunch menu be low:
(B) Burger with French Fries
(C) Chicken and Rice -- $9.50
(T> Tuna Sandwich
KE> EXIT
$8.99
$10.49
Select an option: a
Invalid option. Please re-enter.
Se lect an opt ion_fron the lunch menu be low:
KB) Burger with French Fries --- $8.99
(c) Chicken and Rice --- $9.50
KT> Tuna Sandwich
KE> EXIT
$10.49
Select an option: b](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fefa0f798-7ab2-44e2-9f57-49b4efa8b15c%2Fbb899ba4-1e46-42e4-8165-5e56370d40ad%2Fi1cpq94_processed.png&w=3840&q=75)
![G:\ET575project\LunchMenu.exe
Select an option: b
You ordered a Burger with French Fries.
Select an option from the lunch menu below:
KB) Burger with French Fries ---
(c) Chicken and Rice --- $9.50
KT> Tuna Sandwich
KE> EXIT
$8.99
$10.49
Select an option: t
You ordereda Tuna Sandwich.
Select an option from the lunch menu below:
(B) Burger with French Fries ---
(c) Chicken and Rice
(T> Tuna Sandwich
KE> EXIT
$8.99
$9.50
$10.49
---
---
Select an opt ion: C
You ordereda Chicken and Rice.
Select an option from the lunch menu below:
(B) Burger with French Fries
(C) Chicken and Rice ---
KT> Tuna Sandwich
KE> EXIT
$8.99
---
$9.50
$10.49
---
Select an option: T
You ordered" a Tuna Sandwich.
Select an option from the lunch menu be low:
KB) Burger with French Fries --
(c) Chicken and Rice
(T> Tuna Sandwich
KE) EXIT
$8.99
$9.50
$10.49
---
---
Select an option: 0
Invalid option. Please re-enter.
Select an option from the lunch menu below:
(B) Burger with French Fries --- $8.99
(C) Chicken and Rice ---
(T> Tuna Sandwich
KE> EXIT
$9.50
$10.49
---
Select an option: e
EXIT LUNCH MENU
You have ordered:
1 Burger with French Fries
i Chicken and Rice
2 Tuna Sandwich
Please pay: $39.47
Thank you!
III](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fefa0f798-7ab2-44e2-9f57-49b4efa8b15c%2Fbb899ba4-1e46-42e4-8165-5e56370d40ad%2F8kuuwg4_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)