Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use C++, thanks! And at least tell me how to achieve the requirement that is overstrikingbelow. Storyline (fictional): You are hired to design a food

use C++, thanks!

And at least tell me how to achieve the requirement that is overstrikingbelow.

Storyline (fictional): You are hired to design a food ordering system for the Caf . Your mission is to ensure the ordering business flow is straightforward and easy to use, in particular, allowing the staff to correctly calculate the total amount of the client's order with ease. At this stage, you want to implement your system on a text-based console to simulate the system's main behaviors.

Functional Requirements

1) The staff will enter the order of the customers according to the following item codes:

Sandwiches

Item code name price

A1 Cheese veggie sandwich $30

A2 Salmon & cheese sandwich $34

A3 Chicken Caesar Sandwich $32

2. Quiche, Pei, and Bagel with Cream Cheese

Item code name price

B1 (Quebec homemade) Quiche $28

B2 Bagel with Cream Cheese $20

B3 (East Village Chicken) Pie $28

3. Coffee, Tea, Hot Chocolate, Milk, and Juice

Item code name price

C1 Coffee $36

C2 Green Tea $28

C3 Hot Chocolate $28

C4 Milk $26

C5 Juice $26

4. Set meals

Item code name Set includes - price

S1 Refreshing Breakfast Coffee+Bagel with cream cheese $48

S2 Best Value Breakfast Milk+Chicken Caesar Sandwich+Bagel with Cream Cheese $60

S3 Veggie Lunch Juice+Cheese veggie sandwich $50

S4 Power Lunch Juice+Coffee+Salmon & cheese sandwich+Pie $90

S5 Afternoon Tea Set Coffee or Tea+Quiche or Pie $50

2) A customer can order items from each menu. The Ordering System (OS) then adds the ordered items and reports the sum. If some of the ordered items can be packaged as a set meal, the System will automatically package these items as a set meal. On the other hand, when a set meal is ordered, it will remain to be counted as one unit without splitting the items to form other set meals.

E.g., if a customer orders an A3 (Chicken Caesar Sandwich), B2 (Bagel with Cream Cheese), and C4 (Milk), the Ordering System ( OS) will detect that this order has the same items of set meal S2, Best Value Breakfast, and the price for this order is $60 than $78.

What happens when the food items allow forming of two or more available set meal choices? If there are two or more possible ways to form the new set meal, the System accepts any one of the feasible set meal choices.

E.g., another customer orders B2, B3, C5, A2, and C1, in that order. It can then either confirm the set meal S1 or the set meal S4. Thus, for this order, both the following two orders are OK: 1) S1, B3, C5, and A2; 2) B2 and S4.

3) For any order that is over $100, there is a 5% discount for the order.

4) When the receptionist/employee enters the wrong codes, the Ordering System (OS) will reject the order and request a re-submission.

Required Execution Flow of the Ordering System

1) System welcome message.

2) Explain and provide the system commands to the user. If the user enters an incorrect command, explain and provide the system commands again. Here are the system commands:

System Command Action

0 Exit the System

1 Start Ordering

When the system command is 0, then exit the program. When the system command is 1, go to

step 3.

3) The System then asks the user to input an Order Identification String (OIS). Normally it is the customer's name in one word of less than 40 characters. This order identification string is for the convenience of the employee to call out the customer's name when the order is ready for pick-up. Although the System does not check if the string is actually a name or not.

4) Next, the System will interact with the user to select one item from the food menu. After selection, the System will confirm if the order is complete or the user wants to continue to select the next food item. The confirmation step is provided the following order commands:

Order Command Action

0 Order completed. Ready to check out.

1 continue this order

When the user enters incorrect input, the System will ask the user to re-enter the selection. If the "ready to check out" action is selected, the System will then go to the check-out step shown next.

5) Finally, if the System arrives at the check-out step, it will show the ordered items, their individual prices, and the final total of the order. The total should have a fixed precision to 2 digits after the decimal point.

6) Next, the System will go back to step 2).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions