Assume you work as a cashier in a restaurant. You must keep track of the  amount of money your restaurant earns each day and report it to your boss.  If a customer purchases something, that amount is added to the daily income  book. Take a customer's order and if a customer enters an "X," the order is  complete, and print "Total cost of the items: ". In this way, 3 customers  can order at maximum as your restaurant only serves three customers per  day; after the service, print the day's total income; if the total money  exceeds 500tk, print "Great Work". Otherwise, print "Do Best Next Day." Note: Write a function called “take_order()” that asks users to input food  names, calculate the amount and show it to the customer. When the last  customer buys, you need to also calculate the total income of the day and  show it at the end. Assume that no customers enter invalid food names. The Dictionary ‘price_list’ is set for you and use it in the code for your  convenience. price_list={'Juice':30, 'Fried Rice':150, 'Burger':50, 'Pizza':110, 'Fried  Chicken':90, 'Noodles':70} ======================================================   Function Call 01: take_order() Sample Input_01: Please enter the name of the items: Burger Juice Pizza X Sample Output_01: Total cost: 190 Explanation 1 : The customer ordered 3 things: Burger, Juice and a Pizza.  So the cost of  the three things are added, 50+30+110= 190 and is presented  as the output. ================================================ Function Call 02: take_order() Sample Input_02: Please enter the name of the items: Burger Fried Rice Pizza X Sample Output_02: Total cost: 310 Explanation 2 : The customer ordered 3 things: Burger, Fried Rice and a  Pizza. So the cost of  the three things are added, 50+150+110= 310 and is  presented as the output. ================================================ Function Call 03: take_order() Sample Input_03: Please enter the name of the items: Pizza Noodles X Sample Output_03: Total cost:180 Total income of the day: 680 Great Work Explanation 3 : Over here, the customer ordered 2 things: Pizza and  Noodles. So the cost of  the two things are added, 110+70= 180 and is  presented as the output. The total income was 190 + 310 + 180 = 680. Since it crossed 500 tk, “Great  work” is printed.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 20PE: When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making...
icon
Related questions
icon
Concept explainers
Question

Assume you work as a cashier in a restaurant. You must keep track of the 
amount of money your restaurant earns each day and report it to your boss. 
If a customer purchases something, that amount is added to the daily income 
book.
Take a customer's order and if a customer enters an "X," the order is 
complete, and print "Total cost of the items: ". In this way, 3 customers 
can order at maximum as your restaurant only serves three customers per 
day; after the service, print the day's total income; if the total money 
exceeds 500tk, print "Great Work". Otherwise, print "Do Best Next Day."
Note: Write a function called “take_order()” that asks users to input food 
names, calculate the amount and show it to the customer. When the last 
customer buys, you need to also calculate the total income of the day and 
show it at the end. Assume that no customers enter invalid food names.
The Dictionary ‘price_list’ is set for you and use it in the code for your 
convenience.
price_list={'Juice':30, 'Fried Rice':150, 'Burger':50, 'Pizza':110, 'Fried 
Chicken':90, 'Noodles':70}
======================================================
  Function Call 01:
take_order()
Sample Input_01:
Please enter the name of the items:
Burger
Juice
Pizza
X
Sample Output_01:
Total cost: 190
Explanation 1 : The customer ordered 3 things: Burger, Juice and a Pizza. 
So the cost of  the three things are added, 50+30+110= 190 and is presented 
as the output.
================================================

Function Call 02:
take_order()
Sample Input_02:
Please enter the name of the items:
Burger
Fried Rice
Pizza
X
Sample Output_02:
Total cost: 310
Explanation 2 : The customer ordered 3 things: Burger, Fried Rice and a 
Pizza. So the cost of  the three things are added, 50+150+110= 310 and is 
presented as the output.

================================================
Function Call 03:
take_order()
Sample Input_03:
Please enter the name of the items:
Pizza
Noodles
X
Sample Output_03:
Total cost:180
Total income of the day: 680
Great Work
Explanation 3 : Over here, the customer ordered 2 things: Pizza and 
Noodles. So the cost of  the two things are added, 110+70= 180 and is 
presented as the output.
The total income was 190 + 310 + 180 = 680. Since it crossed 500 tk, “Great 
work” is printed.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Control Structure
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage