In this TMA, you will develop a prototype application to help ERP participants create their Order....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this TMA, you will develop a prototype application to help ERP participants create their "Order". To reduce complexity, ERP enrolment is out-of-scope, instead MOH will provide the participant list via a text file (Appendix A). Deduction of CDC vouchers/digital wallet is out-of-scope. However, your prototype application must produce the order file (Appendix C), so that ERP's partners and CDC can process accordingly. Question 5 (30 marks) In this question, you will implement the EatRightAdmin class and the prototype application focusing on the creation of "Order". You need to make use of the classes created in the previous questions. As ERP is a pilot programme, the EatRightAdmin class is to ensure that a participant can only submit up to 2 orders per day. This EatRightAdmin class will also contain the collections of participants, available Delis and information of orders submitted. Figure Q5 highlight the class diagram for EatRightAdmin EatRightAdmin _DAILY_QUOTA: 2 _participants: dictionary of Participant objects _delis: dictionary of Deli objects _orders: list _init__(self) setupParticipants(self): dictionary setupDelis(self): dictionary readOrders(self): list searchParticipant(self, id: str): Participant searchDeli(self, code): Deli listDelilnventory(self): str countOrders/self, id: str): int listOrders(self, id: str); str addOrder/self, participant: Participant, deliSet: DeliSet): Order saveOrders(self) Figure Q5 Implement the EatRightAdmin class. There is ONE class variable: DAILY QUOTA which is 2, representing the number of orders a participant can submit per day. There are THREE instance variables: o participants (dictionary): collection of ERP participants. The key for this dictionary is the participant's ID, and the value is the Participant object. o _delis (dictionary): collection of delis that ERP is offering. The key for this dictionary is the Deli code, and the value is the Deli object. o_orders (list): this is a list of Order objects, whereby the initial Order objects are created by reading the order information as shown in Appendix C. Constructor performs the following: o Invoke the setupParticipants method to setup Participant objects into the dictionary by reading the information from "Participants.txt". o Invoke the setupDelis method - to setup the Deli objects into the dictionary using the information provided in "Delis.txt". Invoke the readOrders method- to load the Order objects created (for next day) into a list. o Invoke the class method of Order: setNextID, so that the next order ID will continue from the last order created (if exists). Method setup Participants reads the information from "Participants.txt" to setup the ERP participants into the dictionary participants. See Appendix A for file content and format. Method setupDelis reads the information from "Delis.txt" to setup all the Delis currently offered by ERP into the dictionary _Delis. See Appendix B for file content and format. Method readOrders will attempt to find the order file for the next day (filename format "Order_YYYYMMDD.txt") and create an Order object before adding into the list_orders. File content is described in Appendix C. If the order file is not found, manage this exception, and initialise_orders to an empty list. Search for the correct Participant and Deli objects to create the Order object. Given an id as parameter, the method searchParticipant searches and returns the Participant object matching this id. If not found, the method returns None. Given a code as parameter, the searchDeli method searches and returns the Deli object that matches the parameter. If there is no such Deli, the method returns None. listDelilnventory method formats and returns the string representation of all Deli objects, concatenated and one Deli object per line. Example: Available Deli: =============== ceel Smoked Duck Salad cee2 - Strawberry Pudding cee3 - Chocolate Cake ce84 Smoked Salmon cees - chilled Papaya Smoothie cee6 Berry Yoghurt ce07- Beetroot Raita Heel Croissant H082 Chicken Pie H083 Roast Beef H084 - Asparagus & Poached Egg Hees - Apple Sesame Tart HOB6 H087 - Fish & Potato Pie Heas Banana Pancakes H0e9 Boiled Banana with Grated Coconut Hele - Buckwheat Pancakes H011 Chicken with Brown Rice H012 - Carrot & Coriander Soup H013 - Beancurd With Bean Sauce Beef & Brown Rice Spicy Soup Fat: 12.5 Fat: 0.3 Fat: 14.3 Fat: 3.7 Fat: 2.1 Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.88 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Price: $2.40 Price: $3.00 Price: $2.00 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: 4.9 Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.0 Fat: 2.2 Fat: 6.0 Fat: 5.8 Fat: 2.6 Price: $2.50 Fat: 3.3 Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Calories: 85.0 Calories: 97.7 countOrders method has 1 parameter: id. This method searches and returns the number of orders that has participant's id matching the parameter id. If there is no match, the method returns 0. The list Orders method has 1 parameter: id. This method will perform the following: Search for the participant using the given id. o If no such participant, then method should raise ERPException with proper message "You did not sign-up for this programme..." If participant is found, invoke the countOrders method. If there is no order, raise ERPException with message "You did not order any DeliSet..." (b) . If there are orders, the method formats and returns the order information, one per line: Your order(s) for 2023-08-26: =========== Order ID: 20230826001 ID: 54096807E Name: Wong Yong Heng Deliset: My Breakfast Price: $7.00 with Croissant, Smoked Duck Salad, Banana Pancakes Discounts: $1.00 Delivery Fee: $0.00 Final Price: $6.00 Order ID: 20230826003 ID: 54896807E Name: Wong Yong Heng Deliset: Heng Heng Snack Age: 83 Price: $3.50 with Chocolate Cake, Beetroot Raita Discounts: $1.00 Delivery Fee: $0.00 Final Price: $2.50 Consume in 1.5 hrs Age: 83 Consume in 0.5 hrs The addOrder method has a Participant object and a DeliSet object as parameters. This method is invoked when the participant is ready to create Order with the DeliSet. The following tasks need to be performed: o Check that the participant will not break the DAILY QUOTA, with this new order. If yes, this method should raise ERPExcpetion with message "You cannot exceed the daily quota...." If there is no exception, then proceed to: o Create the new Order object, with the given parameters. o Append this new Order object to the instance variable_orders. o Return the Order object. Healthier SG: Est-Right Programme 1. Order Deliset 2. List Orders 3. Quit The saveOrders method will write the return value of the getDetails method of the Order objects in the list _orders into the order file for next day. The file format is defined in Appendix C. There is no need to create the order file if there is no order. (18 marks) Write an application that allow ERP participants to submit and enquire their orders. As this is a pilot programme, the deduction of CDC vouchers/digital wallet will be out-of- scope. Instead, your application must provide the orders' information (Appendix C), so that ERP's partners and CDC can process manually. Before presenting the below menu, your application should create the EatRightAdmin object, so that the participants, delis, and any existing orders can be loaded. Enter choice: The next few paragraphs will explain the 3 options in detail. Option 1: Order DeliSet To order a DeliSet, the following steps and data elements should be collected: Prompt for participant id to help locate the Participant object. o If participant has enrolled in ERP, print his/her eligible discounts. o If there is no such participant, display appropriate message and return to menu. Healthier SG: Est-Right Programme =========== 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): 54096807E You are entitled to the following discount (s): Pioneer citizen: $1 discount Healthier SG: Est-Right Programme =============== ============ 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): S5572364H You are entitled to the following discount (s): Merdeka citizen: $0.50 discount, or $1 discount when order is more than $7 National Day Bonus: enjoy se% off Healthier SG: Est-Right Programme 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): 54096808e You did not sign up for this program Once the participant is located and entitled discounts shown, prompt the participant to enter the customised DeliSet name. This name will help participants to recognise when they enquire about their submitted orders. Next, display the available Delis to the participant to start assembling a Deli Set. Available Deli: ============== ceel Smoked Duck Salad ceez strawberry Pudding cees Chocolate Cake cee4 - Smoked Salmon cees - Chilled Papaya Smoothie cees - Berry Yoghurt cee7 - Beetroot Raita Heel - Croissant Heez Chicken Pie Hee3 Roast Beef Hee4 - Asparagus & Poached Egg Hees - Apple Sesame Tart Hees- Beef & Brown Rice Spicy Soup Hee7 - Fish & Potato Pie Hees Banana Pancakes Hee9 Hele H011 Chicken with Brown Rice He12 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Boiled Banana with Grated Coconut Buckwheat Pancakes Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Price: $2.40 Price: $3.00 Price: $2.00 Price: $2.50 Healthier SG: Est-Right Programme =========== Fat: 12.5 Fat: 0.3 Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: 1. Order Deliset 2. List Orders Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.0 Fat: Fat: 6.0 Fat: 5.8 Fat: Fat: 3.3 Prompt participant to enter the first deli code. o At this point if the participant press 3. Quit Enter choice: 1 Enter NRIC to start your order(s): $4096807E You are entitled to the following discount(s): Pioneer citizen: $1 discount Enter your customised set name: Heng Heng Snack Available Deli: =============== ceel - Smoked Duck Salad ceez - Strawberry Pudding cees Chocolate Cake cee4 - Smoked Salmon cees - Chilled Papaya Smoothie cees Berry Yoghurt cee7 - Beetroot Raita Heel - Croissant Heez Chicken Pie Hee3 Roast Beef Hee4- Asparagus & Poached Egg Hees - Apple Sesame Tart H807 Fish & Potato Pie Hees- Banana Pancakes Beef & Brown Rice Spicy Soup Hee9 Boiled Banana with Grated Coconut Hele Buckwheat Pancakes H011 - Chicken with Brown Rice H012 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Order ID: 20230826003 ID: 540968076 Select Deli by entering the code. to stop Deli <1>: cee3 Ordering conset, Low atset, Low Carbset? : c Deli <2>: H003 Add Deli failed. LowCarbset should not have more than see calories Deli <2>: c807 Deli <3>: Name: Wong Yong Heng Deliset: Heng Heng Snack Price: $3.50 with chocolate Cake, Beetroot Raita Discounts: $1.00 Delivery Fee: $0.00 Final Price: $2.50 Healthier SG: Est-Right Programme ======= 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Price: $2.40 Price: $3.00 Price: $2.00 Price: $2.50 Age: 83 Enter NRIC to start your order(s): $5572364H You are entitled to the following discount(s): Enter your customised set name: Mok Meal Available Deli: =============== cee1 - Smoked Duck Salad ceez - strawberry Pudding Fat: 12.5 Fat: 0.3 Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: 4.9 Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.0 Fat: 2.2 Fat: 6.0 Fat: 5.8 Fat: 2.6 Fat: 3.3 Consume in 0.5 hrs Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Merdeka citizen: se.se discount, or $1 discount when order is more than $7 National Day Bonus: enjoy 50% off Calories: 85.0 Calories: 97.7 Price: $3.00 Fat: 12.5 Calories: 264.5 Calories: 45.5 Price: $2.00 Fat: 0.3 cees Chocolate Cake cee4 - Smoked Salmon cees - Chilled Papaya Smoothie cees- Berry Yoghurt cee7 - Beetroot Raita Heel Croissant Hee2 Chicken Pie Hee3 Roast Beef Hee4 - Asparagus & Poached Egg Hees - Apple Sesame Tart Hees- Beef & Brown Rice Spicy Soup H007- Fish & Potato Pie Hees Banana Pancakes Hee9 Boiled Banana with Grated Coconut Hele Buckwheat Pancakes H011 Chicken with Brown Rice H012 - Carrot & Coriander Soup H013 - Beancurd With Bean Sauce Select Deli by entering the code. to stop Deli <1>: co01 Ordering conSet, Low atset, Low Carbset ?? F Deli <2>: He13 Deli <3> Hees Deli <4> Order ID: 28230826004 ID: 55572364H Name: Sharon Mok Discounts: $4.75 Delivery Fee: $1.99 Final Price: $4.74 Price: $7.50 Healthier SG: Est-Right Programme ====== 1. Order Deliset 2. List Orders 3. Quit Deliset: Mok Meal Consume in 1.0 hrs with Smoked Duck Salad, Beancurd with Bean Sauce, Boiled Banana with Grated Coconut Enter choice: 1 Enter NRIC to start your order(s): 54428006 You are entitled to the following discount(s): Pioneer citizen: $1 discount Enter your customised set name: soft meal Available Deli: cee1 - Smoked Duck Salad ceez - strawberry Pudding cees Chocolate Cake cee4 Smoked Salmon cees - Chilled Papaya Smoothie cees- Berry Yoghurt cee7 - Beetroot Raita Heel Croissant Heez - Chicken Pie Hee3 Roast Beef Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Price: $2.40 Price: $3.00 Price: $2.00 Fat: Price: $2.50 Fat: 3.3 Age: 68 Hee4 - Asparagus & Poached Egg Hees - Apple Sesame Tart Hees- Beef & Brown Rice Spicy Soup Hee7 - Fish & Potato Pie Hees Banana Pancakes Hee9 Boiled Banana with Grated Coconut Hele Buckwheat Pancakes Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: 4.9 Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.8 Fat: 2.2 Fat: 6.0 Fat: 5.8 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Calories: 85.0 Calories: 97.7 Fat: 12.5 Price: $3.00 Price: $2.00 Fat: 0.3 Price: $1.50 Fat: 14.3 Price: $2.40 Fat: 3.7 Price: $2.20 Fat: 2.1 Price: $2.20 Fat: 1.0 Price: $2.00 Fat: 1.0 Price: $2.00 Fat: 7.5 Price: $2.80 Fat: 10.7 Price: $3.50 Fat: 21.8 Price: $3.00 Fat: 4.9 Price: $1.80 Fat: 7.5 Price: $3.20 Fat: 6.3 Price: $3.00 Fat: 5.5 Price: $2.00 Fat: 7.0 Price: $2.00 Fat: 2.2 Price: $2.40 Fat: 6.0 Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 H011 Chicken with Brown Rice He12 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Select Deli by entering the code. to stop Deli <1: ce04 Ordering conSet, Low atset, Low Carbset ?? E Deli <2>: Hees Deli <3>: H012 Add Deli failed. EconSet should not have more than 2 Delis Deli <3> Order ID: 28230826005 ID: 544280062 Name: Tan Yan Meng Deliset: Soft Meal Price: $4.40 with Smoked Salmon, Banana Pancakes $1.00 Discounts: Delivery Fee: $1.99 Final Price: $5.39 Healthier SG: Est-Right Programme 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): $5984462a You are entitled to the following discount(s): Enter your customised set name: WRX Available Deli: =============== cee1 - Smoked Duck Salad ceez strawberry Pudding Chocolate Cake cees cee4 - Smoked Salmon cees Chilled Papaya Smoothie cees- Berry Yoghurt cee7 - Beetroot Raita Heel Croissant Heez - Chicken Pie Hee3 Roast Beef Hee4 - Asparagus & Poached Egg Hees - Apple Sesame Tart Hees Beef & Brown Rice Spicy Soup Merdeka citizen: se.se discount, or $1 discount when order is more than $7 H007 - Fish & Potato Pie Hees Banana Pancakes Price: $3.00 Price: $2.00 Fat: Price: $2.50 Fat: 3.3 Hee9 Boiled Banana with Grated Coconut Hele - Buckwheat Pancakes H011 - Chicken with Brown Rice Age: 75 H012 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Deli <3>: ceez Deli <4>: C004 Fat: 5.8 Consume in 0.5 hrs Select Deli by entering the code. to stop Deli <1>: H003 Ordering conset, Low atset, Low Carbset ?? C Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Fat: 7.5 Price: $3.20 Fat: 6.3 Price: $3.00 Fat: 5.5 Price: $2.00 Fat: 7.8 Price: $2.00 Fat: 2.2 Price: $2.40 Fat: 6.0 Price: $3.00 Fat: 5.8 Price: $2.00 Fat: 2.6 Price: $2.50 Fat: 3.3 Fat: 12.5 Fat: 0.3 Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: Deli <2>: Hees Add Deli failed. LowCarbset should not have more than see calories Deli <2>: H004 Calories: 253.4 Calories: 85.0 Calories: 97.7 Add Deli failed. LowCarbset should not have more than see calories Deli <4>: cee7 Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Calories: 85.0 Calories: 97.7 Deli <5>: Order ID: 28238726006 ID: 55984462A Name: Cheng Wei Ren Deliset: Wrx Price: $10.50 Consume in 0.5 hrs with Roast Beef, Asparagus & Poached Egg. Strawberry Pudding, Beetroot Raita Discounts: $1.00 Delivery Fee: $1.99 Final Price: $11.49 Below are examples of unsuccessful order creation: Healthier SG: Est-Right Programme =========== 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): 54096807E Enter your customised set name: Heng Heng Lunch You are entitled to the following discount(s): Pioneer citizen: $1 discount Available Deli: cee1 - Smoked Duck Salad ceez - strawberry Pudding cees Chocolate Cake cee4 - Smoked Salmon cees - Chilled Papaya Smoothie cees- Berry Yoghurt cee7 - Beetroot Raita Heel - Croissant Heez Chicken Pie Hee3 Roast Beef Age: 64 Hee4- Asparagus & Poached Egg Hees - Apple Sesame Tart Hees- Beef & Brown Rice Spicy Soup H007- Fish & Potato Pie Hees- Banana Pancakes Hee9 Boiled Banana with Grated Coconut Buckwheat Pancakes Hele H011 Chicken with Brown Rice H012 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Fat: 12.5 Fat: 0.3 Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.0 Fat: Price: $2.40 Fat: 6.0 Price: $3.00 Fat: 5.8 Fat: 2.6 Fat: 3.3 ==== Price: $2.00 Price: $2.50 Select Deli by entering the code. to stop Deli <1>: H002 Ordering conSet, Low atset, Low Carbset ?? E Deli <2>: H013 Deli <3>: You cannot exceed the daily quota... Healthier 50: Eat-Right Programme 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): 55572364H Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Calories: 85.0 Calories: 97.7 You are entitled to the following discount(s): Merdeka citizen: $0.50 discount, or $1 discount when order is more than $7 National Day Bonus: enjoy 50% off Enter your customised set name: Mok Dinner Available Deli: ceel - Smoked Duck Salad ceez - Strawberry Pudding cees Chocolate Cake cee4 - Smoked Salmon cees - Chilled Papaya Smoothie cees- Berry Yoghurt cee7 - Beetroot Raita Heel - Croissant Heez - Chicken Pie Hee3 Roast Beef Hee4 - Asparagus & Poached Egg Hees - Apple Sesame Tart Hees Beef & Brown Rice Spicy Soup Hee7 Hees Hee9 Fish & Potato Pie Banana Pancakes Boiled Banana with Grated Coconut Hele Buckwheat Pancakes H011 Chicken with Brown Rice H012 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Select Deli by entering the code. to stop Deli <1: cees No such Deli. Select again. Deli <1>: Aborting Deliset creation. Healthier SG: Eat-Right Programme =================================== 1. Order Deliset 2. List Orders 3. Quit Enter choice: 2 Enter NRIC to list your order(s): $4096807E Your order(s) for 2023-08-26: ============================= Order ID: 20230826001 ID: 54096807E Option 2: List Orders This option allows the participant to enquire submitted order(s), if any. Below are illustrations of list orders: Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Price: $2.40 Price: $3.00 Price: $2.00 Fat: Price: $2.50 Fat: Deliset: My Breakfast Discounts: $1.00 Delivery Fee: $0.00 Final Price: $6.00 Name: Wong Yong Heng Age: 83 Price: $7.00 with Croissant, Smoked Duck Salad, Banana Pancakes Order ID: 20230826003 ID: 54096807E Fat: 12.5 Fat: Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: 4.9 Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.0 Name: Wong Yong Heng Age: 83 Price: $3.50 with Chocolate Cake, Beetroot Raita Deliset: Heng Heng Snack Fat: 2.2 Fat: 6.0 Fat: 5.8 Consume in 1.5 hrs Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Calories: 85.0 Calories: 97.7 Consume in 0.5 hrs Discounts: $1.00 Delivery Fee: $0.00 Final Price: $2.50 Healthier SG: Est-Right Programme ==========: 1. Order Deliset 2. List Orders 3. Quit Enter choice: 2 Enter NRIC to list your order(s): $4096888E You did not sign-up for this programme... Healthier SG: Est-Right Programme 1. Order Deliset 2. List Orders 3. Quit Enter choice: 2 Enter NRIC to list your order(s): $44280067 You did not order any Deliset.... ===== Option 3: Quit You application should ensure that the latest orders' information is saved into the "Order_YYYYMMDD.txt" before the application exits. Errors and exceptions handling Your application must manage all exceptions including input error. Type/Value error should be handled by allowing the user to re-enter. For all menu options, handle any raised exceptions by printing the error messages. (12 marks) Appendix A- Participants.txt Format of the file: Each line of the file contains information in this order: , , 544280062, Tan Yan Meng, 19480708, False $4896887E, Wong Yong Heng, 19401011, True $45010212, Lee Beng Beng, 19458401, True $5385050B, Liu Gu Feng, 19530ses, False S5572364H, Sharon Mok, 19550809, False $65394366,Raymond Low, 196508809, True 57004670I, Soh Yuan Tai, 19700983, True 59672820D, Gan Siao Buang, 19961029, False S5904462A, Cheng Wei Ren, 19591231, False $95115252, Jessica Ong, 19950808, False T0770957E, Alvin Chin, 20070801, False 599144893, Charles Wong, 19990809, False Appendix B-Delis.txt Format of the file: Each line of the file contains information in this order: , , , , , , First char of the deliCode indicate the Deli type: Cxxx for Cold Deli, Hxxx for Hot Deli cee1, Smoked Duck Salad, 3.0,12.5,23,15,16 ce82, Strawberry Pudding, 2.0,0.3,10,0.7,3 cee3, Chocolate Cake, 1.5, 14.3,50.7,5,12 ce84, Smoked salmon,2.4, 3.7,0,16,3 cees, chilled Papaya Smoothie, 2.2, 2.1,21.3,7,8 cee6, Berry Yoghurt Surprise, 2.2,1,9.2, 3,3 ce87, Beetroot Raita, 2.0,1,12.4, 3.5,8 Heel, Croissant, 2.0, 15, 26.7,4.6, Baking H002, Chicken Pie, 2.8, 21.3, 32,10,Baking H003, Roast Beef, 3.5,21.8,0,19.6, Roasting H004, Asparagus & PoschedEgg,3,4.9.3.1,7.9,Boiled Hees, Apple Sesame Tart, 1.8,7.5,49.1, 4.9,Baking H0B6, Beef & Brown Rice Spicy Soup, 3.2,6.35,17.7.18, Boiled H007, Fish & Potato Pie,3,5.5,15,16.5, Baking Hees, Banana Pancakes, 2,7,20,3.6, Pan-Fried H009, Boiled Banana with Grated Coconut, 2,2-2,30.7,2, Boiled Hele, Buckwheat Pancakes, 2.4,6,39,7, Pan-Fried H011, Chicken with Brown Rice, 3,5.8,48.3,15,Steaming H012, Carrot & Coriander Soup 2,2.6, 13.8.1.6, Boiled H013, Beancurd With Bean Sauce, 2.5, 3.3,6.8.10.2, Steaming Appendix C - Order_YYYYMMDD.txt This file will be created by your application, containing orders for the next day. Format of the file: , , , , , Example: "Order_20230826.txt" 20230826001,54096807E, F, My Breakfast, Heel, ceel, Hees 20230826002,55572364H, F, Mok Lunch, cee1, H13, H80 20230826003,54096807E, C, Heng Heng Snack, cee3, cee7 20230826004,55572364H, F, Mok Mesl, ceel, H013, Hees 20230826005,544280062, E, Soft Meal, cee4, Hees 20230826006,55904462A, C, LCM, H003, H804, cee2, C007 ---- END OF ASSIGNMENT ---- In this TMA, you will develop a prototype application to help ERP participants create their "Order". To reduce complexity, ERP enrolment is out-of-scope, instead MOH will provide the participant list via a text file (Appendix A). Deduction of CDC vouchers/digital wallet is out-of-scope. However, your prototype application must produce the order file (Appendix C), so that ERP's partners and CDC can process accordingly. Question 5 (30 marks) In this question, you will implement the EatRightAdmin class and the prototype application focusing on the creation of "Order". You need to make use of the classes created in the previous questions. As ERP is a pilot programme, the EatRightAdmin class is to ensure that a participant can only submit up to 2 orders per day. This EatRightAdmin class will also contain the collections of participants, available Delis and information of orders submitted. Figure Q5 highlight the class diagram for EatRightAdmin EatRightAdmin _DAILY_QUOTA: 2 _participants: dictionary of Participant objects _delis: dictionary of Deli objects _orders: list _init__(self) setupParticipants(self): dictionary setupDelis(self): dictionary readOrders(self): list searchParticipant(self, id: str): Participant searchDeli(self, code): Deli listDelilnventory(self): str countOrders/self, id: str): int listOrders(self, id: str); str addOrder/self, participant: Participant, deliSet: DeliSet): Order saveOrders(self) Figure Q5 Implement the EatRightAdmin class. There is ONE class variable: DAILY QUOTA which is 2, representing the number of orders a participant can submit per day. There are THREE instance variables: o participants (dictionary): collection of ERP participants. The key for this dictionary is the participant's ID, and the value is the Participant object. o _delis (dictionary): collection of delis that ERP is offering. The key for this dictionary is the Deli code, and the value is the Deli object. o_orders (list): this is a list of Order objects, whereby the initial Order objects are created by reading the order information as shown in Appendix C. Constructor performs the following: o Invoke the setupParticipants method to setup Participant objects into the dictionary by reading the information from "Participants.txt". o Invoke the setupDelis method - to setup the Deli objects into the dictionary using the information provided in "Delis.txt". Invoke the readOrders method- to load the Order objects created (for next day) into a list. o Invoke the class method of Order: setNextID, so that the next order ID will continue from the last order created (if exists). Method setup Participants reads the information from "Participants.txt" to setup the ERP participants into the dictionary participants. See Appendix A for file content and format. Method setupDelis reads the information from "Delis.txt" to setup all the Delis currently offered by ERP into the dictionary _Delis. See Appendix B for file content and format. Method readOrders will attempt to find the order file for the next day (filename format "Order_YYYYMMDD.txt") and create an Order object before adding into the list_orders. File content is described in Appendix C. If the order file is not found, manage this exception, and initialise_orders to an empty list. Search for the correct Participant and Deli objects to create the Order object. Given an id as parameter, the method searchParticipant searches and returns the Participant object matching this id. If not found, the method returns None. Given a code as parameter, the searchDeli method searches and returns the Deli object that matches the parameter. If there is no such Deli, the method returns None. listDelilnventory method formats and returns the string representation of all Deli objects, concatenated and one Deli object per line. Example: Available Deli: =============== ceel Smoked Duck Salad cee2 - Strawberry Pudding cee3 - Chocolate Cake ce84 Smoked Salmon cees - chilled Papaya Smoothie cee6 Berry Yoghurt ce07- Beetroot Raita Heel Croissant H082 Chicken Pie H083 Roast Beef H084 - Asparagus & Poached Egg Hees - Apple Sesame Tart HOB6 H087 - Fish & Potato Pie Heas Banana Pancakes H0e9 Boiled Banana with Grated Coconut Hele - Buckwheat Pancakes H011 Chicken with Brown Rice H012 - Carrot & Coriander Soup H013 - Beancurd With Bean Sauce Beef & Brown Rice Spicy Soup Fat: 12.5 Fat: 0.3 Fat: 14.3 Fat: 3.7 Fat: 2.1 Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.88 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Price: $2.40 Price: $3.00 Price: $2.00 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: 4.9 Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.0 Fat: 2.2 Fat: 6.0 Fat: 5.8 Fat: 2.6 Price: $2.50 Fat: 3.3 Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Calories: 85.0 Calories: 97.7 countOrders method has 1 parameter: id. This method searches and returns the number of orders that has participant's id matching the parameter id. If there is no match, the method returns 0. The list Orders method has 1 parameter: id. This method will perform the following: Search for the participant using the given id. o If no such participant, then method should raise ERPException with proper message "You did not sign-up for this programme..." If participant is found, invoke the countOrders method. If there is no order, raise ERPException with message "You did not order any DeliSet..." (b) . If there are orders, the method formats and returns the order information, one per line: Your order(s) for 2023-08-26: =========== Order ID: 20230826001 ID: 54096807E Name: Wong Yong Heng Deliset: My Breakfast Price: $7.00 with Croissant, Smoked Duck Salad, Banana Pancakes Discounts: $1.00 Delivery Fee: $0.00 Final Price: $6.00 Order ID: 20230826003 ID: 54896807E Name: Wong Yong Heng Deliset: Heng Heng Snack Age: 83 Price: $3.50 with Chocolate Cake, Beetroot Raita Discounts: $1.00 Delivery Fee: $0.00 Final Price: $2.50 Consume in 1.5 hrs Age: 83 Consume in 0.5 hrs The addOrder method has a Participant object and a DeliSet object as parameters. This method is invoked when the participant is ready to create Order with the DeliSet. The following tasks need to be performed: o Check that the participant will not break the DAILY QUOTA, with this new order. If yes, this method should raise ERPExcpetion with message "You cannot exceed the daily quota...." If there is no exception, then proceed to: o Create the new Order object, with the given parameters. o Append this new Order object to the instance variable_orders. o Return the Order object. Healthier SG: Est-Right Programme 1. Order Deliset 2. List Orders 3. Quit The saveOrders method will write the return value of the getDetails method of the Order objects in the list _orders into the order file for next day. The file format is defined in Appendix C. There is no need to create the order file if there is no order. (18 marks) Write an application that allow ERP participants to submit and enquire their orders. As this is a pilot programme, the deduction of CDC vouchers/digital wallet will be out-of- scope. Instead, your application must provide the orders' information (Appendix C), so that ERP's partners and CDC can process manually. Before presenting the below menu, your application should create the EatRightAdmin object, so that the participants, delis, and any existing orders can be loaded. Enter choice: The next few paragraphs will explain the 3 options in detail. Option 1: Order DeliSet To order a DeliSet, the following steps and data elements should be collected: Prompt for participant id to help locate the Participant object. o If participant has enrolled in ERP, print his/her eligible discounts. o If there is no such participant, display appropriate message and return to menu. Healthier SG: Est-Right Programme =========== 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): 54096807E You are entitled to the following discount (s): Pioneer citizen: $1 discount Healthier SG: Est-Right Programme =============== ============ 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): S5572364H You are entitled to the following discount (s): Merdeka citizen: $0.50 discount, or $1 discount when order is more than $7 National Day Bonus: enjoy se% off Healthier SG: Est-Right Programme 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): 54096808e You did not sign up for this program Once the participant is located and entitled discounts shown, prompt the participant to enter the customised DeliSet name. This name will help participants to recognise when they enquire about their submitted orders. Next, display the available Delis to the participant to start assembling a Deli Set. Available Deli: ============== ceel Smoked Duck Salad ceez strawberry Pudding cees Chocolate Cake cee4 - Smoked Salmon cees - Chilled Papaya Smoothie cees - Berry Yoghurt cee7 - Beetroot Raita Heel - Croissant Heez Chicken Pie Hee3 Roast Beef Hee4 - Asparagus & Poached Egg Hees - Apple Sesame Tart Hees- Beef & Brown Rice Spicy Soup Hee7 - Fish & Potato Pie Hees Banana Pancakes Hee9 Hele H011 Chicken with Brown Rice He12 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Boiled Banana with Grated Coconut Buckwheat Pancakes Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Price: $2.40 Price: $3.00 Price: $2.00 Price: $2.50 Healthier SG: Est-Right Programme =========== Fat: 12.5 Fat: 0.3 Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: 1. Order Deliset 2. List Orders Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.0 Fat: Fat: 6.0 Fat: 5.8 Fat: Fat: 3.3 Prompt participant to enter the first deli code. o At this point if the participant press 3. Quit Enter choice: 1 Enter NRIC to start your order(s): $4096807E You are entitled to the following discount(s): Pioneer citizen: $1 discount Enter your customised set name: Heng Heng Snack Available Deli: =============== ceel - Smoked Duck Salad ceez - Strawberry Pudding cees Chocolate Cake cee4 - Smoked Salmon cees - Chilled Papaya Smoothie cees Berry Yoghurt cee7 - Beetroot Raita Heel - Croissant Heez Chicken Pie Hee3 Roast Beef Hee4- Asparagus & Poached Egg Hees - Apple Sesame Tart H807 Fish & Potato Pie Hees- Banana Pancakes Beef & Brown Rice Spicy Soup Hee9 Boiled Banana with Grated Coconut Hele Buckwheat Pancakes H011 - Chicken with Brown Rice H012 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Order ID: 20230826003 ID: 540968076 Select Deli by entering the code. to stop Deli <1>: cee3 Ordering conset, Low atset, Low Carbset? : c Deli <2>: H003 Add Deli failed. LowCarbset should not have more than see calories Deli <2>: c807 Deli <3>: Name: Wong Yong Heng Deliset: Heng Heng Snack Price: $3.50 with chocolate Cake, Beetroot Raita Discounts: $1.00 Delivery Fee: $0.00 Final Price: $2.50 Healthier SG: Est-Right Programme ======= 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Price: $2.40 Price: $3.00 Price: $2.00 Price: $2.50 Age: 83 Enter NRIC to start your order(s): $5572364H You are entitled to the following discount(s): Enter your customised set name: Mok Meal Available Deli: =============== cee1 - Smoked Duck Salad ceez - strawberry Pudding Fat: 12.5 Fat: 0.3 Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: 4.9 Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.0 Fat: 2.2 Fat: 6.0 Fat: 5.8 Fat: 2.6 Fat: 3.3 Consume in 0.5 hrs Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Merdeka citizen: se.se discount, or $1 discount when order is more than $7 National Day Bonus: enjoy 50% off Calories: 85.0 Calories: 97.7 Price: $3.00 Fat: 12.5 Calories: 264.5 Calories: 45.5 Price: $2.00 Fat: 0.3 cees Chocolate Cake cee4 - Smoked Salmon cees - Chilled Papaya Smoothie cees- Berry Yoghurt cee7 - Beetroot Raita Heel Croissant Hee2 Chicken Pie Hee3 Roast Beef Hee4 - Asparagus & Poached Egg Hees - Apple Sesame Tart Hees- Beef & Brown Rice Spicy Soup H007- Fish & Potato Pie Hees Banana Pancakes Hee9 Boiled Banana with Grated Coconut Hele Buckwheat Pancakes H011 Chicken with Brown Rice H012 - Carrot & Coriander Soup H013 - Beancurd With Bean Sauce Select Deli by entering the code. to stop Deli <1>: co01 Ordering conSet, Low atset, Low Carbset ?? F Deli <2>: He13 Deli <3> Hees Deli <4> Order ID: 28230826004 ID: 55572364H Name: Sharon Mok Discounts: $4.75 Delivery Fee: $1.99 Final Price: $4.74 Price: $7.50 Healthier SG: Est-Right Programme ====== 1. Order Deliset 2. List Orders 3. Quit Deliset: Mok Meal Consume in 1.0 hrs with Smoked Duck Salad, Beancurd with Bean Sauce, Boiled Banana with Grated Coconut Enter choice: 1 Enter NRIC to start your order(s): 54428006 You are entitled to the following discount(s): Pioneer citizen: $1 discount Enter your customised set name: soft meal Available Deli: cee1 - Smoked Duck Salad ceez - strawberry Pudding cees Chocolate Cake cee4 Smoked Salmon cees - Chilled Papaya Smoothie cees- Berry Yoghurt cee7 - Beetroot Raita Heel Croissant Heez - Chicken Pie Hee3 Roast Beef Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Price: $2.40 Price: $3.00 Price: $2.00 Fat: Price: $2.50 Fat: 3.3 Age: 68 Hee4 - Asparagus & Poached Egg Hees - Apple Sesame Tart Hees- Beef & Brown Rice Spicy Soup Hee7 - Fish & Potato Pie Hees Banana Pancakes Hee9 Boiled Banana with Grated Coconut Hele Buckwheat Pancakes Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: 4.9 Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.8 Fat: 2.2 Fat: 6.0 Fat: 5.8 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Calories: 85.0 Calories: 97.7 Fat: 12.5 Price: $3.00 Price: $2.00 Fat: 0.3 Price: $1.50 Fat: 14.3 Price: $2.40 Fat: 3.7 Price: $2.20 Fat: 2.1 Price: $2.20 Fat: 1.0 Price: $2.00 Fat: 1.0 Price: $2.00 Fat: 7.5 Price: $2.80 Fat: 10.7 Price: $3.50 Fat: 21.8 Price: $3.00 Fat: 4.9 Price: $1.80 Fat: 7.5 Price: $3.20 Fat: 6.3 Price: $3.00 Fat: 5.5 Price: $2.00 Fat: 7.0 Price: $2.00 Fat: 2.2 Price: $2.40 Fat: 6.0 Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 H011 Chicken with Brown Rice He12 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Select Deli by entering the code. to stop Deli <1: ce04 Ordering conSet, Low atset, Low Carbset ?? E Deli <2>: Hees Deli <3>: H012 Add Deli failed. EconSet should not have more than 2 Delis Deli <3> Order ID: 28230826005 ID: 544280062 Name: Tan Yan Meng Deliset: Soft Meal Price: $4.40 with Smoked Salmon, Banana Pancakes $1.00 Discounts: Delivery Fee: $1.99 Final Price: $5.39 Healthier SG: Est-Right Programme 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): $5984462a You are entitled to the following discount(s): Enter your customised set name: WRX Available Deli: =============== cee1 - Smoked Duck Salad ceez strawberry Pudding Chocolate Cake cees cee4 - Smoked Salmon cees Chilled Papaya Smoothie cees- Berry Yoghurt cee7 - Beetroot Raita Heel Croissant Heez - Chicken Pie Hee3 Roast Beef Hee4 - Asparagus & Poached Egg Hees - Apple Sesame Tart Hees Beef & Brown Rice Spicy Soup Merdeka citizen: se.se discount, or $1 discount when order is more than $7 H007 - Fish & Potato Pie Hees Banana Pancakes Price: $3.00 Price: $2.00 Fat: Price: $2.50 Fat: 3.3 Hee9 Boiled Banana with Grated Coconut Hele - Buckwheat Pancakes H011 - Chicken with Brown Rice Age: 75 H012 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Deli <3>: ceez Deli <4>: C004 Fat: 5.8 Consume in 0.5 hrs Select Deli by entering the code. to stop Deli <1>: H003 Ordering conset, Low atset, Low Carbset ?? C Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Fat: 7.5 Price: $3.20 Fat: 6.3 Price: $3.00 Fat: 5.5 Price: $2.00 Fat: 7.8 Price: $2.00 Fat: 2.2 Price: $2.40 Fat: 6.0 Price: $3.00 Fat: 5.8 Price: $2.00 Fat: 2.6 Price: $2.50 Fat: 3.3 Fat: 12.5 Fat: 0.3 Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: Deli <2>: Hees Add Deli failed. LowCarbset should not have more than see calories Deli <2>: H004 Calories: 253.4 Calories: 85.0 Calories: 97.7 Add Deli failed. LowCarbset should not have more than see calories Deli <4>: cee7 Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Calories: 85.0 Calories: 97.7 Deli <5>: Order ID: 28238726006 ID: 55984462A Name: Cheng Wei Ren Deliset: Wrx Price: $10.50 Consume in 0.5 hrs with Roast Beef, Asparagus & Poached Egg. Strawberry Pudding, Beetroot Raita Discounts: $1.00 Delivery Fee: $1.99 Final Price: $11.49 Below are examples of unsuccessful order creation: Healthier SG: Est-Right Programme =========== 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): 54096807E Enter your customised set name: Heng Heng Lunch You are entitled to the following discount(s): Pioneer citizen: $1 discount Available Deli: cee1 - Smoked Duck Salad ceez - strawberry Pudding cees Chocolate Cake cee4 - Smoked Salmon cees - Chilled Papaya Smoothie cees- Berry Yoghurt cee7 - Beetroot Raita Heel - Croissant Heez Chicken Pie Hee3 Roast Beef Age: 64 Hee4- Asparagus & Poached Egg Hees - Apple Sesame Tart Hees- Beef & Brown Rice Spicy Soup H007- Fish & Potato Pie Hees- Banana Pancakes Hee9 Boiled Banana with Grated Coconut Buckwheat Pancakes Hele H011 Chicken with Brown Rice H012 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Fat: 12.5 Fat: 0.3 Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.0 Fat: Price: $2.40 Fat: 6.0 Price: $3.00 Fat: 5.8 Fat: 2.6 Fat: 3.3 ==== Price: $2.00 Price: $2.50 Select Deli by entering the code. to stop Deli <1>: H002 Ordering conSet, Low atset, Low Carbset ?? E Deli <2>: H013 Deli <3>: You cannot exceed the daily quota... Healthier 50: Eat-Right Programme 1. Order Deliset 2. List Orders 3. Quit Enter choice: 1 Enter NRIC to start your order(s): 55572364H Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Calories: 85.0 Calories: 97.7 You are entitled to the following discount(s): Merdeka citizen: $0.50 discount, or $1 discount when order is more than $7 National Day Bonus: enjoy 50% off Enter your customised set name: Mok Dinner Available Deli: ceel - Smoked Duck Salad ceez - Strawberry Pudding cees Chocolate Cake cee4 - Smoked Salmon cees - Chilled Papaya Smoothie cees- Berry Yoghurt cee7 - Beetroot Raita Heel - Croissant Heez - Chicken Pie Hee3 Roast Beef Hee4 - Asparagus & Poached Egg Hees - Apple Sesame Tart Hees Beef & Brown Rice Spicy Soup Hee7 Hees Hee9 Fish & Potato Pie Banana Pancakes Boiled Banana with Grated Coconut Hele Buckwheat Pancakes H011 Chicken with Brown Rice H012 - Carrot & Coriander Soup H013 Beancurd With Bean Sauce Select Deli by entering the code. to stop Deli <1: cees No such Deli. Select again. Deli <1>: Aborting Deliset creation. Healthier SG: Eat-Right Programme =================================== 1. Order Deliset 2. List Orders 3. Quit Enter choice: 2 Enter NRIC to list your order(s): $4096807E Your order(s) for 2023-08-26: ============================= Order ID: 20230826001 ID: 54096807E Option 2: List Orders This option allows the participant to enquire submitted order(s), if any. Below are illustrations of list orders: Price: $3.00 Price: $2.00 Price: $1.50 Price: $2.40 Price: $2.20 Price: $2.20 Price: $2.00 Price: $2.00 Price: $2.80 Price: $3.50 Price: $3.00 Price: $1.80 Price: $3.20 Price: $3.00 Price: $2.00 Price: $2.00 Price: $2.40 Price: $3.00 Price: $2.00 Fat: Price: $2.50 Fat: Deliset: My Breakfast Discounts: $1.00 Delivery Fee: $0.00 Final Price: $6.00 Name: Wong Yong Heng Age: 83 Price: $7.00 with Croissant, Smoked Duck Salad, Banana Pancakes Order ID: 20230826003 ID: 54096807E Fat: 12.5 Fat: Fat: 14.3 Fat: 3.7 Fat: 2.1 Fat: 1.0 Fat: 1.0 Fat: 7.5 Fat: 10.7 Fat: 21.8 Fat: 4.9 Fat: 7.5 Fat: 6.3 Fat: 5.5 Fat: 7.0 Name: Wong Yong Heng Age: 83 Price: $3.50 with Chocolate Cake, Beetroot Raita Deliset: Heng Heng Snack Fat: 2.2 Fat: 6.0 Fat: 5.8 Consume in 1.5 hrs Calories: 264.5 Calories: 45.5 Calories: 351.5 Calories: 97.3 Calories: 132.1 Calories: 57.8 Calories: 72.6 Calories: 130.3 Calories: 180.3 Calories: 274.6 Calories: 88.1 Calories: 283.5 Calories: 199.9 Calories: 175.5 Calories: 157.4 Calories: 150.6 Calories: 238.0 Calories: 253.4 Calories: 85.0 Calories: 97.7 Consume in 0.5 hrs Discounts: $1.00 Delivery Fee: $0.00 Final Price: $2.50 Healthier SG: Est-Right Programme ==========: 1. Order Deliset 2. List Orders 3. Quit Enter choice: 2 Enter NRIC to list your order(s): $4096888E You did not sign-up for this programme... Healthier SG: Est-Right Programme 1. Order Deliset 2. List Orders 3. Quit Enter choice: 2 Enter NRIC to list your order(s): $44280067 You did not order any Deliset.... ===== Option 3: Quit You application should ensure that the latest orders' information is saved into the "Order_YYYYMMDD.txt" before the application exits. Errors and exceptions handling Your application must manage all exceptions including input error. Type/Value error should be handled by allowing the user to re-enter. For all menu options, handle any raised exceptions by printing the error messages. (12 marks) Appendix A- Participants.txt Format of the file: Each line of the file contains information in this order: , , 544280062, Tan Yan Meng, 19480708, False $4896887E, Wong Yong Heng, 19401011, True $45010212, Lee Beng Beng, 19458401, True $5385050B, Liu Gu Feng, 19530ses, False S5572364H, Sharon Mok, 19550809, False $65394366,Raymond Low, 196508809, True 57004670I, Soh Yuan Tai, 19700983, True 59672820D, Gan Siao Buang, 19961029, False S5904462A, Cheng Wei Ren, 19591231, False $95115252, Jessica Ong, 19950808, False T0770957E, Alvin Chin, 20070801, False 599144893, Charles Wong, 19990809, False Appendix B-Delis.txt Format of the file: Each line of the file contains information in this order: , , , , , , First char of the deliCode indicate the Deli type: Cxxx for Cold Deli, Hxxx for Hot Deli cee1, Smoked Duck Salad, 3.0,12.5,23,15,16 ce82, Strawberry Pudding, 2.0,0.3,10,0.7,3 cee3, Chocolate Cake, 1.5, 14.3,50.7,5,12 ce84, Smoked salmon,2.4, 3.7,0,16,3 cees, chilled Papaya Smoothie, 2.2, 2.1,21.3,7,8 cee6, Berry Yoghurt Surprise, 2.2,1,9.2, 3,3 ce87, Beetroot Raita, 2.0,1,12.4, 3.5,8 Heel, Croissant, 2.0, 15, 26.7,4.6, Baking H002, Chicken Pie, 2.8, 21.3, 32,10,Baking H003, Roast Beef, 3.5,21.8,0,19.6, Roasting H004, Asparagus & PoschedEgg,3,4.9.3.1,7.9,Boiled Hees, Apple Sesame Tart, 1.8,7.5,49.1, 4.9,Baking H0B6, Beef & Brown Rice Spicy Soup, 3.2,6.35,17.7.18, Boiled H007, Fish & Potato Pie,3,5.5,15,16.5, Baking Hees, Banana Pancakes, 2,7,20,3.6, Pan-Fried H009, Boiled Banana with Grated Coconut, 2,2-2,30.7,2, Boiled Hele, Buckwheat Pancakes, 2.4,6,39,7, Pan-Fried H011, Chicken with Brown Rice, 3,5.8,48.3,15,Steaming H012, Carrot & Coriander Soup 2,2.6, 13.8.1.6, Boiled H013, Beancurd With Bean Sauce, 2.5, 3.3,6.8.10.2, Steaming Appendix C - Order_YYYYMMDD.txt This file will be created by your application, containing orders for the next day. Format of the file: , , , , , Example: "Order_20230826.txt" 20230826001,54096807E, F, My Breakfast, Heel, ceel, Hees 20230826002,55572364H, F, Mok Lunch, cee1, H13, H80 20230826003,54096807E, C, Heng Heng Snack, cee3, cee7 20230826004,55572364H, F, Mok Mesl, ceel, H013, Hees 20230826005,544280062, E, Soft Meal, cee4, Hees 20230826006,55904462A, C, LCM, H003, H804, cee2, C007 ---- END OF ASSIGNMENT ----
Expert Answer:
Related Book For
Measurement Theory In Action
ISBN: 9780367192181
3rd Edition
Authors: Kenneth S Shultz, David Whitney, Michael J Zickar
Posted Date:
Students also viewed these programming questions
-
THIRD AVENUE SOFTWARE HEALTH-CARE APP PROJECT This case is new for the ninth edition of Information Technology Project Management . The case provides an opportunity to apply agile and Scrum...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
1. A projectile is launched in a vertical plane, at an angle 0 with initial velocity vo. It must be caught in a frictionless circular tube of radius R in such a way that the trajectory of the...
-
W8 video Lecture 3 "contracts: Capacity, Consent, and Legality" W8 Discussion "Review and Reflection" Review and Reflection Review and reflect on that you learned in the past 8 weeks. What is the...
-
Explain why it may be impractical to require serializability for long-duration transactions.
-
Youve just taken a job at the central bank and are given the job of calculating the appropriate nominal interest rate for a number of different Treasury bonds with different maturity dates. You have...
-
Compare and contrast the following techniques based on costs and benefits: Test data method Base case system evaluation Tracing Integrated test facility Parallel simulation
-
which muscle were use to extend and splay your finger outward?
-
Below is review of the books and records at December 31 for East West College. The review has identified the matters that may need addressing. Record any adjustments required to complete the year end...
-
(a) What is the quantity of the resource constraint (i.e., how much resource is available over these two periods) __________________________________________________ (b) What area maximizes the total...
-
If boys and girls are equally likely, groups of 400 births have a mean of 200 girls and a standard deviation of 10 girls. Is 232 girls in 400 births an unusually high number of girls?
-
Given a linear time-invariant system, prove the properties below: (a) A constant group delay is a necessary but not sufficient condition for the delay introduced by the system to a sinusoid to be...
-
We define the even and odd parts of a sequence \(x(n), \mathcal{E}\{x(n)\}\) and \(\mathcal{O}\{x(n)\}\) respectively, as \[\begin{aligned}\mathcal{E}\{x(n)\} & =\frac{x(n)+x(-n)}{2}...
-
Prove that the Fourier transform of \(x(n)=\mathrm{e}^{\mathrm{j} \omega_{0} n}\) is given by Equation (2.216) by computing \[X\left(\mathrm{e}^{\mathrm{j} \omega} ight)=\lim _{N ightarrow \infty}...
-
Mensa International calls itself the international high IQ society, and it has more than 100,000 members. Mensa states that candidates for membership of Mensa must achieve a score at or above the...
-
Julio and Maria Gomez are retired and they live at 567 Ono Way, Cambria, CA 94457. Julio's Social Security number is 777-88-5555 and Maria's is 666-88-4444. Julio received Social Security retirement...
-
Havel says the grocer doesnt believe what is on the sign and indeed, he says the grocers customers will barely notice it. But Havel maintains that the sign serves a specific function. How would you...
-
Given that 14 SMEs were used to provide the ratings in question 10, which items do you feel have received a CVR so low that you would recommend deleting the item? Justify your response.
-
Joelle, a life span developmental psychology graduate student, recently completed an internship at an adult day care facility. The majority of the facilitys clientele were elderly individuals who...
-
In reviewing the item writing tips in this module, is there any particular tip that you feel is especially important? Why? Are there any item writing tips that you would take issue with? Explain.
-
Answer the following questions: 1. Name at least five industries that might be affected by weather. 2. Is it appropriate for the forensic accountant/fraud examiner to examine the effect of weather?...
-
Discuss why collusive frauds, especially when perpetrated among related parties, is particularly difficult to detect?
-
d that Fairmont is not in complianThe forensic audit has determinece with Federal withholding requirements for FICA and Medicare because FICA and Medicare were not withheld from employee paychecks...
Study smarter with the SolutionInn App