question archive Python coding   This is a restaurant ordering program

Python coding   This is a restaurant ordering program

Subject:Computer SciencePrice: Bought3

Python coding

 

This is a restaurant ordering program.

 

The program first gets the menus by import a menu.txt file.

 

Then ask the guest by input

• How many dishes are needed?

• Let the guest enter the number of the dish(What dishes are needed?)

 

 

Then output receipt.txt

• Ask if there is a discount before exporting

• There are three discount options100% 95% 90% 85%

• Tax is 11%

• Suggested tip is (18%; 20%; 22%) of price payable

 

The output should have:

• Arrange the guests' dishes (including number, name, and price)

total price of this order

• The price payable for this order (total price * discount * tax; if no discount then discount = 100%)with two decimal places

Suggested tip (all three listed)

 

Requirement checklist:

• 1 of the container types (list, tuple, set) used by the application

• 1 dictionary container type used by the application

• 1 iteration type (for, while)

• 1 conditional (if)

• 1 try block with an else condition(handle input error)

• 1 user-defined function

 

At last

Provide 2 unit tests that prove two of your public class methods work as expected.

 

Example

How many dishes are needed?

4

What dishes are needed?

002

003

007

008

What discounts are needed?

95%

======================restaurant name======================

002 General Tso's Chicken 16$

003 Peking Duck 28$

007 Spicy Crayfish 35$

008 Garlic Cabbage 12$

 

Your subtotal is 91$

Your finaltotal is 95.96$

 

tipping options
18% ? 95.96+17.27=113.23
20% ? 95.96+19.19=115.15
22%? 95.96+21.11=117.07
customize_____

 

menu.txt
001 Kung Pao Chicken 16$
002 General Tso's Chicken 16$
003 Peking Duck 28$
004 Tomato and Egg 18$
005 Grilled Fish 30$
006 Roasted Whole Lamb 45$
007 Spicy Crayfish 35$
008 Garlic Cabbage 12$
009 Three Vegetable Soup 15$

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions