0% found this document useful (0 votes)
8 views17 pages

Restaurant Management System Code

The document outlines the hardware and software requirements for a restaurant management system, including specifications for CPU, RAM, disk space, and necessary software like Python and MySQL. It provides a detailed Python code for creating a restaurant database, managing menu items, and calculating bills for customers. Additionally, it includes functions for user interaction, such as viewing menu types and placing orders, along with a simple user authentication system for restaurant owners.

Uploaded by

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

Restaurant Management System Code

The document outlines the hardware and software requirements for a restaurant management system, including specifications for CPU, RAM, disk space, and necessary software like Python and MySQL. It provides a detailed Python code for creating a restaurant database, managing menu items, and calculating bills for customers. Additionally, it includes functions for user interaction, such as viewing menu types and placing orders, along with a simple user authentication system for restaurant owners.

Uploaded by

gaurangjiagrawal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

KANHA MAKAHAN MILLENNIUM SCHOOL

MATHURA,UTTAR PRADESH

HARDWARE AND SOFTWARE REQUIRED


HARDWARE
 X86 64-BIT CPU(INTEL).
 4 GB RAM
 5 GB FREE DISK SPACE

SOFTWARE
 PYTHON 3.9.3
 MYSQL
 PYTHON CONNECTOR
 WINDOWS 11
CODING
#Checking connection
if con.is_connected():
print("Connected Successfull\n")
else:
print("Try Again")

#Taking input of name and phone number


name=input("Enter your Name: ")
num=int(input("Enter your Number: "))

#Cursor
cur=[Link]()

#Creating database restro

[Link]("CREATE DATABASE IF NOT EXISTS


RESTRO")

#Creating table type to ask user for type he wants


to choose from type

[Link]("USE RESTRO")
[Link]("CREATE TABLE IF NOT EXISTS
TYPE(sno int,typo varchar(20)) ")
[Link]("DELETE FROM TYPE")
[Link]("INSERT INTO TYPE
VALUES(1,'DRINKS')")
[Link]("INSERT INTO TYPE VALUES(2,'LIGHT
FOOD')")
[Link]("INSERT INTO TYPE VALUES(3,'MAIN
COURSE')")
[Link]("SELECT * FROM TYPE")
data1=[Link]()
[Link]()

#Creating table dishes to ask user what he wants


to order from type 1

[Link]("USE RESTRO")
[Link]("CREATE TABLE IF NOT EXISTS
dishes1(code int,dish varchar(20),price int) ")
[Link]("DELETE FROM dishes")
[Link]("INSERT INTO dishes
VALUES(101,'MASALA TEA','29')")
[Link]("INSERT INTO dishes
VALUES(102,'COFFEE','39')")
[Link]("INSERT INTO dishes
VALUES(103,'WATER','10')")
[Link]("INSERT INTO dishes VALUES(104,'COLD
COFFEE','69')")
[Link]("INSERT INTO dishes
VALUES(105,'JUICE','49')")
[Link]("SELECT * FROM dishes")
data2=[Link]()
[Link]()

#Creating table dishes to ask user what he wants


to order from type 2

[Link]("USE RESTRO")
[Link]("CREATE TABLE IF NOT EXISTS
dishes2(code int,dish varchar(20),price int) ")
[Link]("DELETE FROM dishes")
[Link]("INSERT INTO dishes
VALUES(106,'MOMOS','69')")
[Link]("INSERT INTO dishes
VALUES(107,'CHAAP','119')")
[Link]("INSERT INTO dishes
VALUES(108,'SPRING ROLL','99')")
[Link]("INSERT INTO dishes
VALUES(109,'SANDWICH','89')")
[Link]("INSERT INTO dishes VALUES(110,'JAM
BREAD','69')")
[Link]("INSERT INTO dishes
VALUES(111,'PIZZA','139')")
[Link]("SELECT * FROM dishes")
data3=[Link]()
[Link]()
#Creating table dishes to ask user what he wants
to order from type 3

[Link]("USE RESTRO")
[Link]("CREATE TABLE IF NOT EXISTS
dishes3(code int,dish varchar(20),price int) ")
[Link]("DELETE FROM dishes")
[Link]("INSERT INTO dishes
VALUES(112,'BIRYANI','199')")
[Link]("INSERT INTO dishes
VALUES(113,'DOSA','149')")
[Link]("INSERT INTO dishes
VALUES(114,'CHOLE','119')")
[Link]("INSERT INTO dishes
VALUES(115,'CHAPATI','19')")
[Link]("INSERT INTO dishes
VALUES(116,'DHOKLA','99')")
[Link]("INSERT INTO dishes
VALUES(117,'BUTTER CHICKEN','249')")
[Link]("INSERT INTO dishes VALUES(118,'DAL
MAKHNI','189')")
[Link]("INSERT INTO dishes VALUES(119,'SHAHI
PANEER','219')")
[Link]("INSERT INTO dishes VALUES(120,'ALL
BREADS','99')")
[Link]("SELECT * FROM dishes")
data4=[Link]()
[Link]()

#Function to view type

def viewtype():
print("\t+----------------------+")
print("\t| S no. | TYPE |")
print("\t+----------------------+")
for i in data1:
print("\t|", i[0], " |", i[1], " " * (11 - len(i[1])), "|")
print("\t+----------------------+")

#function to view menu as per type

def viewmenu(typ):

#TYPE 1 OF DRINKS
if (typ==1):
print("\t+------------------------------+")
print("\t| S no. | DISH | PRICE |")
print("\t+------------------------------+")
for i in data2:
print("\t|", i[0], " |", i[1], " " * (11 - len(i[1])),
"|",i[2]," |")
print("\t+------------------------------+")
#TYPE 2 OF LIGHT FOOD
elif(typ==2):
print("\t+------------------------------+")
print("\t| S no. | DISH | PRICE |")
print("\t+------------------------------+")
for i in data3:
print("\t|", i[0], " |", i[1], " " * (12 - len(i[1])),
"|",i[2]," "*(3-len(str(i[2]))),"|")
print("\t+------------------------------+")

#TYPE 3 OF MAIN COURSE


elif(typ==3):
print("\t+----------------------------------+")
print("\t| S no. | DISH | PRICE |")
print("\t+----------------------------------+")
for i in data4:
print("\t|", i[0], " |", i[1], " " * (16 - len(i[1])),
"|",i[2]," "*(3-len(str(i[2]))),"|")
print("\t+----------------------------------+")
else:
print("invalid choice")

#function to tell the no of items

def quanitem(ch2):
quan=int(input("Enter the Quantity: "))
priced = {101:29, 102:39, 103:10, 104:69, 105:49,
106:69, 107:119, 108:99,
109:89,110:69,111:139,112:199,113:149,114:119,115:19,1
16:99,117:249,118:189,119:219,120:99}
if ch2 in priced:
return quan*priced[ch2]
else:
print("Enter valid Code")

#Function to calculate full bill

def totalbil(ttbill):
gst=0.18*ttbill
finalbill=ttbill+gst
return finalbill

# Main program

totalbill = 0
while True:

ch = int(input("\nENTER THE FOLLOWING\[Link]


RESTAURANT OWNER\[Link] CUSTOMER\[Link]
EXIT\nChoice: "))

# FOR RESTAURANT OWNER


if ch == 1:
print("\nENTER THE FOLLOWING TO LOGIN")
u="gaurang"
p="gaurangrestro"
ucheck=input("ENTER THE USER ID")
pcheck=input("ENTER THE PASSWORD")

#CHECKING PASSWORD
if(ucheck==u and pcheck==p):

#TYPE 1 OF DRINKS
print("DRINKS AVAILABLE\n")
print("\t+------------------------------+")
print("\t| S no. | DISH | PRICE |")
print("\t+------------------------------+")
for i in data2:
print("\t|", i[0], " |", i[1], " " * (11 - len(i[1])),
"|",i[2]," |")
print("\t+------------------------------+")

#TYPE 2 OF LIGHT FOOD


print("\nLIGHT FOOD AVAILABLE\n")
print("\t+------------------------------+")
print("\t| S no. | DISH | PRICE |")
print("\t+------------------------------+")
for i in data3:
print("\t|", i[0], " |", i[1], " " * (12 -
len(i[1])),"|",i[2]," "*(3-len(str(i[2]))),"|")
print("\t+------------------------------+")

#TYPE 3 OF MAIN COURSE


print("\nMAIN COURSE AVAILABLE\n")
print("\t+----------------------------------+")
print("\t| S no. | DISH | PRICE |")
print("\t+----------------------------------+")
for i in data4:
print("\t|", i[0], " |", i[1], " " * (16 -
len(i[1])),"|",i[2]," "*(3-len(str(i[2]))),"|")
print("\t+----------------------------------+")

#MESSAGE
print("THESE ITEMS ARE AVAILABLE
CURRENTLY")
break
else:
print("WRONG CREDENTIALS\nTRY AGAIN")

# FOR CUSTOMER
elif ch == 2:
while True:
ch1 = int(input("\nENTER THE
FOLLOWING\[Link] ORDER\[Link] EXIT\nChoice: "))
if ch1 == 1:
viewtype()
typ = int(input("\nEnter the type: "))
viewmenu(typ)
ch2 = int(input("\nEnter the dish code: "))
itemtotal = quanitem(ch2)
if itemtotal:
totalbill += itemtotal
print("\nItem added\nCurrent total:", totalbill)
elif ch1 == 2:
final = totalbil(totalbill)
print()
print("="*31)
print(" RESTAURANT BILL RECEIPT ")
print("="*31)
print("TOTAL :",totalbill)
print("GST :",0.18*totalbill)
print("final bill :", final)
print("="*31)
break
else:
print("\nINVALID CHOICE")
break
elif ch == 3:
print("\nTHANKS FOR COMING")
break
else:
print("\nINVALID CHOICE")
break
[Link]()
SQL TABLE
OUTPUT
IF THE MENU IS CHECKED BY RESTAURANT
OWNER:-
IF THE MENU IS CHECKED BY CUSTOMER FOR
ORDERING WITH BILL:-
BIBLIOGRAPHY
 [Link]
 [Link]
 [Link]
 CLASS 12 NCERT BOOK BY
SUMITA ARORA.

You might also like