c
c
class
Restaurant:
def init
(self):
# Initialize
menu,
inventory,
orders,
customers,
staff,
logistics, and
finances
self.menu = {
"Starters":
{"Spring
Rolls":
150,
"Garlic
Bread":
100,
"Samosa":
50},
"North
Indian":
{"Butter
Chicken":
300,
"Paneer
Tikka":
250, "Dal
Makhani":
200},
"Chinese": {"Chow Mein": 200, "Dumplings": 180, "Sweet and Sour
Chicken": 250}, "Desserts": {"Ice Cream": 120, "Brownie": 150, "Gulab
Jamun": 80},
"Beverages": {"Cola": 50, "Lemonade": 60, "Coffee": 100}
}
self.inventory = {
"Spring Rolls": 50, "Garlic Bread": 100, "Samosa": 150,
"Butter Chicken": 30, "Paneer Tikka": 40, "Dal Makhani": 50,
"Chow Mein": 60, "Dumplings": 50, "Sweet and Sour
Chicken": 40, "Ice Cream": 100, "Brownie": 80, "Gulab
Jamun": 120,
"Cola": 200, "Lemonade": 150, "Coffee": 100
}
self.orders = {}
self.order_id = 1
self.customers =
{} self.feedback
= []
self.staff = ["John",
"Emily", "Raj",
"Priya", "Ali"]
self.delivery_vehicl
order = {}
print("\nPlace your order (type 'done' when
finished):") while True:
item = input("Enter item name: ").strip()
if item.lower() ==
'done': break
if not any(item in items
for items in
self.menu.values()):
print(f"{item} is not on the menu. Please try
again.") continue
quantity = int(input(f"Enter quantity for {item}: "))
if self.inventory.get(item, 0) < quantity:
print(f"Sorry, only {self.inventory.get(item, 0)} {item}(s)
available!") continue
self.inventory[item] -= quantity
for category, items in
self.menu.items(): if item in
items:
order[item] = items[item] *
quantity
total = self.calculate_bill(order, 2) # Assume Takeaway for
simplicity self.select_payment_method(total)
self.customers[phone]["history"].append(order)
self.customers[phone]["points"] +=
total // 10 self.feedback_prompt()
def owner_portal(self):
"""Provide access to the owner's portal for managing the
restaurant.""" print("\nOwner Portal")
print("1. View Orders")
print("2. Manage
Delivery") print("3. View
Staff") print("4.
Financial Report")
print("5. Manage
Inventory")
print("6. Manage
Staff")
choice = int(input("Enter your choice (1-
6): ")) if choice == 1:
self.view_orders()
elif choice == 2:
self.manage_deliver
y()
elif choice == 3:
self.view_staff(
) elif choice ==
4:
self.financial
_report()
elif choice == 5:
self.manage_inventor
y()
elif choice == 6:
self.manage_staff
() else:
print("Invalid
choice!")
def
view_orders(self):
"""Display all orders placed
so far.""" print("\nOrders
Summary:")
if not self.orders:
print("No orders placed
yet.") else:
for order_id, details in
self.orders.items():
print(f"Order ID: {order_id}, Total: ₹
{details['total']}") print("Items:")
for item, price in details["order"].items():
print(f" {item}: ₹{price}")
def manage_delivery(self):
"""View the current delivery
status.""" print("\nDelivery
def financial_report(self):
"""Display the total
earnings."""
print(f"\nTotal Earnings: ₹
{self.total_earnings:.2f}")
def manage_inventory(self):
"""Manage the inventory by restocking
items.""" print("\nManage Inventory")
for item, quantity in self.inventory.items():
print(f"{item}: {quantity} units")
item = input("Enter the name of the item to restock:
").strip() if item in self.inventory:
amount = int(input(f"Enter quantity to add for {item}:
"))
self.inventory[item] += amount
print(f"{item} restocked. Current quantity:
{self.inventory[item]}") else:
print("Item not found in inventory!")
def manage_staff(self):
"""Manage the staff by adding or removing
members.""" print("\nManage Staff")
print("1. Add Staff\n2. Remove Staff")
choice = int(input("Enter your choice
(1-2): ")) if choice == 1:
new_staff = input("Enter the name
of the new staff member: ").strip()
self.staff.append(new_staff)
print(f"{new_staff} added to the
staff!")
elif choice == 2:
for idx, name in enumerate(self.staff,
start=1): print(f"{idx}. {name}")
staff_id = int(input("Enter the number of
the staff member to remove: "))
if 1 <= staff_id <= len(self.staff):
removed = self.staff.pop(staff_id - 1)
print(f"{removed} removed from the
staff!")
else:
print("Invalid staff number!")
def main(self):
"""Main method to run the restaurant
system.""" while True:
print("\nWelcome to the Restaurant
Management System!")
print("1. Customer Portal\n2. Owner Portal\n3.
Exit") choice = int(input("Enter your choice (1-
3): "))
if choice == 1:
self.customer_portal
() elif choice == 2:
self.owner_portal(
)
elif choice == 3:
print("Exiting system. Thank
choice = int(input("Enter your choice (1-
3): ")) if choice == 1:
self.register_customer()
elif choice == 2:
self.place_order
()
elif choice == 3:
self.view_feedback
() else:
print("Invalid
choice!")
def
view_feedback(self):
"""View all feedback collected from
customers.""" print("\nCustomer
Feedback:")
if not self.feedback:
print("No feedback
available.") else:
for fdb in self.feedback:
print(f" - {fdb}")
def place_order(self):
"""Allow a customer to place an order by selecting items from
the menu.""" phone = input("Enter your phone number: ").strip()
if phone not in self.customers:
print("You are not registered. Please
register first!") self.register_customer()
return
self.show_me
nu() order = {}
print("\nPlace
your order (type
'done' when
finished):")
while True:
item = input("Enter item name:
").strip() if item.lower() == 'done':
break
if not any(item in items for items in
self.menu.values()): print(f"{item} is not on the
menu. Please try again.")
continue
quantity = int(input(f"Enter quantity for
total = self.calculate_bill(order, 2) # Assume Takeaway for
simplicity self.select_payment_method(total)
self.customers[phone]["history"].append(order)
self.customers[phone]["points"] +=
total // 10 self.feedback_prompt()
def feedback_prompt(self):
"""Collect feedback from the
customer."""
feedback = input("Please provide your feedback
(optional): ").strip() if feedback:
self.feedback.append(feedback)
print("Thank you for your feedback!")
if choice == 1:
self.view_orders
()
elif choice == 2:
self.manage_deliver
y() elif choice == 3:
self.view_staff()
elif choice == 4:
self.financial_report
() elif choice == 5:
self.manage_inv
entory()
elif choice == 6:
self.manage_staff
() else:
print("Invalid
choice!")
def
view_orders(self):
"""Display all orders placed
so far.""" print("\nOrders
Summary:")
if not self.orders:
print("No orders placed
yet.") else:
for order_id, details in
self.orders.items():
print(f"Order ID: {order_id}, Total: ₹
{details['total']}") print("Items:")
for item, price in details["order"].items():
print(f" {item}: ₹{price}")
def manage_delivery(self):
"""View the current delivery
status.""" print("\nDelivery
Status:")
print(f"Delivery Partners
Available:
{self.delivery_partners}")
print(f"Delivery Vehicles
Available:
{self.delivery_vehicles}")
def view_staff(self):
"""View the list of staff
members.""" print("\nStaff
List:")
for name in self.staff:
print(f" - {name}")
def financial_report(self):
"""Display the total
earnings."""
print(f"\nTotal Earnings: ₹
{self.total_earnings:.2f}")
def manage_inventory(self):
def manage_staff(self):
"""Manage the staff by adding or removing
members.""" print("\nManage Staff")
print("1. Add Staff\n2. Remove Staff")
choice = int(input("Enter your choice (1-
2): ")) if choice == 1:
new_staff = input("Enter the name of
the new staff member: ").strip()
self.staff.append(new_staff)
print(f"{new_staff} added to the
staff!")
elif choice == 2:
for idx, name in enumerate(self.staff,
start=1): print(f"{idx}. {name}")
staff_id = int(input("Enter the number of
the staff member to remove: "))
if 1 <= staff_id <= len(self.staff):
removed = self.staff.pop(staff_id - 1)
print(f"{removed} removed from the
staff!")
else:
print("Invalid staff number!")
def main(self):
"""Main method to run the restaurant
system.""" while True:
print("\nWelcome to the Restaurant
Management System!")
print("1. Customer Portal\n2. Owner Portal\n3.
Exit") choice = int(input("Enter your choice (1-
3): "))
if choice == 1:
self.customer_portal
() elif choice == 2:
self.owner_portal(
)
elif choice == 3:
print("Exiting system. Thank
you!") break
else:
print("Invalid choice! Please
try again.")
def customer_portal(self):
"""Provide customer portal for placing orders and viewing
feedback.""" print("\nCustomer Portal")
print("1. Register\n2. Place Order\n3. View Feedback")
choice = int(input("Enter your choice
(1-3): ")) if choice == 1:
self.register_customer()
elif choice == 2:
self.place_order
()
elif choice == 3:
self.view_feedback
() else:
print("Invalid
choice!")
for fdb in
self.feedback:
print(f" - {fdb}")