Question: Can anybody please help me with the Python code? Thanks a lot. 1. Dessert Shop Part 11: Customer Class II Problem Add the ability to
Can anybody please help me with the Python code? Thanks a lot.





1. Dessert Shop Part 11: Customer Class II Problem Add the ability to keep track of customers and what they have ordered. In this part of the project, you will store a customer list and store an order history for each customer. Changes to dessertshop module - Add a module-level dictionary called customer_db: Dict[str,Customer]. The key is the customer name and the value is the Customer object. - For simplicity we assume that customer names are unique for distinct customers. Changes to console application user input 1. After the order is complete (the user hits enter indicating they don't want to add any more items), ask for the customer's name. 2. Check to see if the customer already exists as a key in the customer_db 3. If they don't exist in the customer_db, create a new Customer object and add it to the customer_db 4. Whether they already existed or not, get the Customer object associated with the customer name in the customer_db and add the order to the Customer object's order history. 5. Asking for the customer name should happen AFTER you finish adding items to the order but BEFORE you ask for the payment type. Changes to the Receipt output Add the following new fields to the top of and the printed receipt. Customer Name: Apollo Customer ID: 1000 Total Orders: 1 Add a test case to guarantee that customer IDs are unique during the lifetime of the program as it's running. How you do it is up to you, but don't make it too complex. Example Scenario The receipts below aren't formatted to match the printed receipts we expect, but all the information you need is there. Customer Name: James Customer ID: 1001 Total Orders: 1 Press y and Bnter to start a new order. 1: Candy 2: Cookie 3: Ice Cream 4 : Sunday 5: Admin Module What would you like to add to the order? (1-5, Enter for done): Enter the customer name: Mei What form of payment will be used? (CASH, CARD, PHONE): Phone Gummy Bears (Bag) 0.25 lbs. \& $0.35/1b.:$0.09 [Tax: $0.01] Oatmeal Raisin Cookies (Box) 2 cookies 8 \$3.45/dozen: $0.58 [Tax: \$0.04] Pistachio Ice Cream (Bowl) 2 scoops \& $0.79/ scoop: $1.58 [Tax: \$0.11] Total number of items in order: 3 Order Subtotals: $2.24 [Tax: $0.16 ] Order Total: $2.41 Paid for with PHONE. Customer Name: Mei Customer ID: 1002 Total Orders: 1 Press y and Bnter to start a new order. 1: Candy 2: Cookie 3: Ice Cream 4 : Sunday 5: Admin Module What would you like to add to the order? (1-5, Enter for done): Enter the customer name: Tony What form of payment will be used? (CASH, CARD, PHONE): Cash Gummy Bears (Bag) 0.25 lbs. \& $0.35/1b. : $0.09 [Tax: $0.01] Oatmeal Raisin Cookies (Box) 2 cookies \& $3.45/ dozen: $0.58 [Tax: $0.04 ] Pistachio Ice Cream (Bowl) 2 scoops \& $0.79/ scoop: $1.58 [Tax: \$0.11] Total number of items in order: 3 Order Subtotals: $2.24 [Tax: $0.16 ] Order Total: $2.41 Paid for with cAsH. Customer Name: Tony Customer ID: 1000 Total Orders: 2 Press y and Bnter to start a new order. Grading Rubric Customer ID attribute assigns a correct unique ID to each new Customer. You decide how to guarantee that ID's are unique, we don't specify it for you. customer_db exists at module scope, and uses the required key and value types Regression tests all pass The most you can earn is 50% if items in the rubric are not correct and all done. 1. Dessert Shop Part 11: Customer Class II Problem Add the ability to keep track of customers and what they have ordered. In this part of the project, you will store a customer list and store an order history for each customer. Changes to dessertshop module - Add a module-level dictionary called customer_db: Dict[str,Customer]. The key is the customer name and the value is the Customer object. - For simplicity we assume that customer names are unique for distinct customers. Changes to console application user input 1. After the order is complete (the user hits enter indicating they don't want to add any more items), ask for the customer's name. 2. Check to see if the customer already exists as a key in the customer_db 3. If they don't exist in the customer_db, create a new Customer object and add it to the customer_db 4. Whether they already existed or not, get the Customer object associated with the customer name in the customer_db and add the order to the Customer object's order history. 5. Asking for the customer name should happen AFTER you finish adding items to the order but BEFORE you ask for the payment type. Changes to the Receipt output Add the following new fields to the top of and the printed receipt. Customer Name: Apollo Customer ID: 1000 Total Orders: 1 Add a test case to guarantee that customer IDs are unique during the lifetime of the program as it's running. How you do it is up to you, but don't make it too complex. Example Scenario The receipts below aren't formatted to match the printed receipts we expect, but all the information you need is there. Customer Name: James Customer ID: 1001 Total Orders: 1 Press y and Bnter to start a new order. 1: Candy 2: Cookie 3: Ice Cream 4 : Sunday 5: Admin Module What would you like to add to the order? (1-5, Enter for done): Enter the customer name: Mei What form of payment will be used? (CASH, CARD, PHONE): Phone Gummy Bears (Bag) 0.25 lbs. \& $0.35/1b.:$0.09 [Tax: $0.01] Oatmeal Raisin Cookies (Box) 2 cookies 8 \$3.45/dozen: $0.58 [Tax: \$0.04] Pistachio Ice Cream (Bowl) 2 scoops \& $0.79/ scoop: $1.58 [Tax: \$0.11] Total number of items in order: 3 Order Subtotals: $2.24 [Tax: $0.16 ] Order Total: $2.41 Paid for with PHONE. Customer Name: Mei Customer ID: 1002 Total Orders: 1 Press y and Bnter to start a new order. 1: Candy 2: Cookie 3: Ice Cream 4 : Sunday 5: Admin Module What would you like to add to the order? (1-5, Enter for done): Enter the customer name: Tony What form of payment will be used? (CASH, CARD, PHONE): Cash Gummy Bears (Bag) 0.25 lbs. \& $0.35/1b. : $0.09 [Tax: $0.01] Oatmeal Raisin Cookies (Box) 2 cookies \& $3.45/ dozen: $0.58 [Tax: $0.04 ] Pistachio Ice Cream (Bowl) 2 scoops \& $0.79/ scoop: $1.58 [Tax: \$0.11] Total number of items in order: 3 Order Subtotals: $2.24 [Tax: $0.16 ] Order Total: $2.41 Paid for with cAsH. Customer Name: Tony Customer ID: 1000 Total Orders: 2 Press y and Bnter to start a new order. Grading Rubric Customer ID attribute assigns a correct unique ID to each new Customer. You decide how to guarantee that ID's are unique, we don't specify it for you. customer_db exists at module scope, and uses the required key and value types Regression tests all pass The most you can earn is 50% if items in the rubric are not correct and all done
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
