0% found this document useful (0 votes)
9 views

c

Uploaded by

sharanyaanand5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

c

Uploaded by

sharanyaanand5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

CERTIFICATE

This is to certify that Miss. Disha Singh of Class


12th (COMMERCE) of Canossa School has
successfully completed her Computer practical
report file. She has taken proper care and utmost
sincerity in completion of her project. The
approach towards the topic has been sincere.

I certify that this project is upto my expectations


and as per the guidelines issued by the CBSE,
NEW DELHI.
INDEX

S. No. CONTENT Pg.


No.
1. INTRODUCTION 1~3
2. SOURCE CODE 4~13
3. OUTPUT 14~25
4. CONCLUSION 26
5. BIBLIOGRAPHY 27
from datetime import datetime

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 calculate_bill(self, order, choice):


"""Calculate the total bill for an
order.""" total =
sum(order.values())
discount = total * 0.03 if total >
1000 else 0
gst = total * 0.05
packing = 50 if choice in [1, 2] else 0
final_total = total - discount + gst +
packing print("\nOrder Summary:")
for item, price in order.items():
print(f"{item}: ₹
{price}")
print(f"Subtotal: ₹
{total}")
print(f"Discount: -₹
{discount:.2f}")
print(f"GST (5%): +₹{gst:.2f}")
print(f"Packing Charges: +₹
{packing}") print(f"Total: ₹
{final_total:.2f}")
self.orders[self.order_id] =
{"order": order, "total": final_total}
self.total_earnings +=
final_total
print(f"\nOrder placed successfully! Order ID:
{self.order_id}") self.order_id += 1
return final_total

def select_payment_method(self, amount):


"""Allow the customer to choose a payment method and confirm
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!")

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}")

# Create a restaurant instance and start


the system restaurant = Restaurant()
restaurant.main()def
register_customer(self):
"""Register a new customer with their name and phone
number.""" name = input("Enter your name: ").strip()
phone = input("Enter your phone number: ").strip()
if phone not in self.customers:
self.customers[phone] = {"name": name, "history": [],
"points": 0} print("Customer registered successfully!")
else:
print("Customer already exists!")

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 calculate_bill(self, order, choice):


"""Calculate the total bill for an
order.""" total =
sum(order.values())
discount = total * 0.03 if total >
1000 else 0
gst = total * 0.05
packing = 50 if choice in [1, 2] else 0
final_total = total - discount + gst +
packing print("\nOrder Summary:")
for item, price in order.items():
print(f"{item}: ₹
{price}")
print(f"Subtotal: ₹
{total}")
print(f"Discount: -₹
{discount:.2f}")
print(f"GST (5%): +₹{gst:.2f}")
print(f"Packing Charges: +₹
{packing}") print(f"Total: ₹
{final_total:.2f}")
self.orders[self.order_id] =
{"order": order, "total": final_total}
self.total_earnings +=
final_total
print(f"\nOrder placed successfully! Order ID:
{self.order_id}") self.order_id += 1
return final_total

def select_payment_method(self, amount):


"""Allow the customer to choose a payment method and confirm
payment.""" print("\nSelect Payment Method:")
print("1. Cash\n2. Card\n3. UPI\n4. Net Banking")
choice = int(input("Enter your choice (1-4): "))
payment_methods = {1: "Cash", 2: "Card", 3: "UPI", 4:
"Net Banking"} method = payment_methods.get(choice,
"Invalid")
if method == "Invalid":
print("Invalid payment method
selected!") else:
print(f"Payment of ₹{amount:.2f}
successful via {method}. Thank
you!")

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}")

# Create a restaurant instance and start the


system restaurant = Restaurant()
restaurant.main()
CONCLUSION

The Restaurant Management System is a Python-based project that


efficiently handles restaurant operations for both customers and
owners. Customers can view a categorized menu, register, place
orders, and provide feedback. The program calculates bills with GST,
discounts, and packing charges. Owners can manage orders,
inventory, staff, and view financial reports.This user-friendly system
highlights practical Python programming concepts, such as object-
The Restaurant
oriented design,Management
and servesSystem
as an is a Python-based
excellent project
foundation for that efficiently
real-world
handles restaurant
applications andoperations for both customers
future enhancements. and owners.
It is ideal Customers can view
for school-level
aprojects,
categorized menu, register,
demonstrating place orders,
simplicity, and provide
functionality, andfeedback. The program
scalability.
calculates bills with GST, discounts, and packing charges. Owners can manage
orders, inventory, staff, and view financial reports.This user-friendly system
highlights practical Python programming concepts, such as object-oriented design,
and serves as an excellent foundation for real-world applications and future
enhancements. It is ideal for school-level projects, demonstrating simplicity,
functionality, and scalability.

You might also like