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;
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps