You have to design a Food Ordering app for a restaurant The application will have a log-in for admin and users to log-in -------------------------------- Admin ---------------------------------- β‘οΈ Admin will have the following functionalities: β¬ οΈ π 1. Add new food items. Food Item will have the following details: π΄ FoodID //It should be generated automatically by the application. π΄ Name π΄ Quantity. For eg, 100ml, 250gm, 4pieces etc π΄ Price π΄ Discount π΄ Stock. Amount left in stock in the restaurant. π 2. Edit food items using FoodID. π 3. View the list of all food items. π 4. Remove a food item from the menu using FoodID. --------------------------------- User ---------------------------------- β‘οΈ The user will have the following functionalities: β¬ οΈ π 1. Register on the application. Following to be entered for registration: π΄ Full Name π΄ Phone Number π΄ Email π΄ Address π΄ Password π 2. Log in to the application π 3. The user will see 3 options: π΄ Place New Order π΄ Order History π΄ Update Profile π 4. Place New Order: The user can place a new order at the restaurant. π΅ Show list of food. The list item should as follows: π΄ Tandoori Chicken (4 pieces) [INR 240] π΄ Vegan Burger (1 Piece) [INR 320] π΄ Truffle Cake (500gm) [INR 900] π 5. Users should be able to select food by entering an array of numbers. For example, if the user wants to order Vegan Burger and Truffle Cake they should enter [2, 3] π 6. Once the items are selected user should see the list of all the items selected. The user will also get an option to place an order. π 7. Order History should show a list of all the previous orders
# Python 3.7 import random #global variables #food_list = [] #functions def get_food_id(): return random.randint(1000,9999) def add_food_items(food_list, food_name, qty, price, discount, stock): food_list.append({ "FoodID": get_food_id(), "Name": food_name, "Quantity": qty, "Price": price, "Discount": discount, "Stock": stock, }) def edit_food_items(food_list, food_id, new_food_name, new_qty, new_price, new_discount, new_stock): for food in food_list: if food["FoodID"] == food_id: food["Name"] = new_food_name food["Quantity"] = new_qty food["Price"] = new_price food["Discount"] = new_discount food["Stock"] = new