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; }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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
Transcribed Image Text: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
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
Transcribed Image Text: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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY