Computer Science
Computer Science
COMPUTER SCIENCE
INVESTIGATORY
PROJECT
TOPIC:- RESTAURANT
MANAGEMENT
MADE BY:-
NAME:- SHIV NITIN GUPTA
INDEX
Acknowledgement 01
Certificate 02
Introduction 03
Requirements 04
Modules 05-19
Code 20-34
Output 35-37
Analysis 38
Conclusion 39
Bibliography 40
ACKNOWLEDGMENT
01
CERTIFICATE
EXAMINATION ROLL NO:
This is to certify that Shiv Nitin Gupta of Class XII-A
has satisfactorily completed his computer science project
work on the topic Restaurant management for the year
2024-2025
Date: _____________
_________________ ________________
__________________ _________________
02
INTRODUCTION
03
REQUIREMENTS
HARDWARE REQUIRED
Printer, to print the required documents of
the project
Compact Drive
Processor : Processor Intel(R) Core(TM) i5-
8265U CPU @ 1.60GHz, 1800 Mhz, 4 Core(s)
SSD -256 GB
RAM-8.00 GB
SOFTWARE REQUIRED
04
MODULES
Tkinter Module:
Before we proceed, let's define some of the common
terms.
Window:This term has different meanings in different
contexts, but in general itrefers to a rectangular area
somewhere on your display screen.
Top-level window:A window that exists independently
on your screen. It will bedecorated with the standard
frame and controls for your system's desktop manager.
You can move it around on your desktop. You can
generally resize it, although your application can prevent
this
Widget:The generic term for any of the building blocks
that make up an applicationin a graphical user interface.
Examples of widgets: buttons, radio buttons, text fields,
frames, and text labels.
05
Frame:In Tkinter, the Frame widget is the basic unit of
organization for complexlayouts. A frame is a
rectangular area that can contain other widgets.
GUI.
1. Tk():To create a main window, tkinter offers a
method ‘Tk()’. The basic codeused to create the
main window of the application is:
from tkinter import *
master = Tk()
Then title, geometry, resizable properties of the master
window are set.
06
Frame:In Tkinter, the Frame widget is the basic unit of
organization for complexlayouts. A frame is a
rectangular area that can contain other widgets.
GUI.
1. Tk():To create a main window, tkinter offers a
method ‘Tk()’. The basic codeused to create the
main window of the application is:
from tkinter import * master = Tk()
Then title, geometry, resizable properties of the master
window are set.
master.mainloop()
08
tkinter also offers access to the geometric configuration
09
characters 'n', 's', 'e', and 'w'. For example, the value
sticky='ns' would stretch this element to adhere to the
north and south sides of the cavity within its parent
element.
explained below:
10
various fonts, a button can only display text in a single
font. The text of a button can span
11
control variable and show specifies the character
toappear as the user types. To make a “password” entry
that echoes each character as an asterisk, set show='*'.
The insertion cursor is displayed in the Entry widget only
when the user clicks the mouse somewhere in the
widget. It usually appears as a blinking vertical line
inside the widget. This insertion cursor shows where new
text will be inserted. Positions within the entry widget's
displayed text are given as an index. Index 0 refers to the
position before the existing text and the constant
ENDrefers to the position after the existing text.
12
BoolVar(). All control variables have these two methods:
w = Frame(master)
lbox1.config(yscrollcommand=sbar1.set) where
Mysql.Connector Module:
13
MySQL Connector is a standardized database driver
provided by MySQL to access the MySQL database from
Python. In order to use this module, the mysql connector
is to be downloaded and installed as follows:
C:\Users\Your
Name\AppData\Local\Programs\Python\Python36-
32\Scripts>python -m
import mysql.connector
Mysql.Connector.Error:
import mysql.connector
try:
cnx=mysql.connector.connect(user=’scott’,password
14
=’’tiger’,
database=’bookstore’)
cursor=cnx.cursor()
15
sent to the database server, where it gets executed and
the resultset (the set of records retrieved as per query) is
sent over the connection to you in one go. But you may
want to access the retrieved data, one row at a time. But
query processing cannot happen as one row at a time, so
a special type of control structure called database cursor
can be created that gets access of all the records as per
query (called the resultset) and allows you to traverse the
resultset row by row. The syntax to create a database
cursor is as follows: cur = conn.cursor()where we
established database connection through connection
object “conn” earlier and we have created a cursor object
“cur” using the same connection object “conn”.
required.
Main.py Module:
The master window has two buttons (Enter and Exit).
Login_command() function is called when the user clicks
on the Enter button and the master window is closed
when Exit button is clicked.
17
len() function :The len() function returns the number
of items (length) of anobject.
string.isnumeric()
into a string.
string itself.
19
CODE
### Importing required libraries ###
from tkinter import *
import random
import time
from tkinter import ttk
from tkinter import messagebox
import sqlite3
from tkinter import *
def Database():
connectn = sqlite3.connect("Restaurant.db")
20
dr text, ct text,sb text,tax text,sr text,tot text)")
Service = str(ser)
overall = str(ptax + ser + sub)
21
.set(ptax)
subtotal.set(sub)
service.set(ser)
total.set(overall)
service.set("") total.set("")
# Topframe
topframe.pack(side=TOP)
# rightframe
22
my_tree.insert('', 'end', values=(data)) cursor.close()
connectn.close()
foreground="black", rowheight=40,
fieldbackground="white"
)
style.map('Treeview',
background=[('selected', 'lightblue')])
my_tree['columns'] = ("ordno", "piz", "bur", "ice", "dr", "ct", "sb", "tax", "sr", "tot")
horizontal_bar = ttk.Scrollbar(rightframe,
orient="horizontal")
horizontal_bar.configure(command=my_tree.xview)
my_tree.configure(xscrollcommand=horizontal_bar.set)
horizontal_bar.pack(fill=X, side=BOTTOM)
vertical_bar.configure(command=my_tree.yview)
my_tree.configure(yscrollcommand=vertical_bar
.set) vertical_bar.pack(fill=Y, side=RIGHT)
23
# defining column for table
my_tree.pack()
DisplayData()
24
# defining add function to add record def add():
Database() # getting data orders =
orderno.get() pizzas = pizza.get() burgers
= burger.get() ices = icecream.get() drinkss
= drinks.get() costs = cost.get() subtotals
= subtotal.get() taxs = tax.get() services =
service.get() totals = total.get()
if orders == "" or pizzas == "" or burgers == "" or ices == ""
or drinkss == "" or costs == "" or subtotals == "" or taxs == "" or services == ""
or totals == "":
'INSERT INTO Restaurantrecords (ordno, piz, bur , ice ,dr ,ct ,sb ,tax, sr, tot)
VALUES (?,?,?,?,?,?,?,?,?,?)',
totals));
connectn.commit()
DisplayData()
connectn.close()
25
# defining function to delete record def Delete():
# open database Database() if not
my_tree.selection():
messagebox.showwarning("Warning", "Select data
to delete") else:
result = messagebox.askquestion('Confirm',
'Are you sure you want to delete this record?',
# Time
column=0)
26
column=0)
justify='right',
textvariable=pizza).grid(row=2, column=1)
# burger
column=0)
justify='right',
textvariable=icecream).grid(row=4, column=1)
justify='right', # drinks
column=0)
justify='right',
textvariable=drinks).grid(row=5, column=1)
textvariable=cost).grid(row=6, column=1)
27
# subtotal
textvariable=tax).grid(row=8, column=1)
# service
column=0)
column=0)
textvariable=total).grid(row=10, column=1)
# ---button--
28
width=6, command=tottal).grid(row=6, column=3)
pady=5, width=12,
command=exit).grid(row=6, column=2)
connectn = sqlite3.connect("Restaurant.db")
29
cursor = connectn.cursor()
eid = email.get()
feedback1 = ""
feedback2 = ""
feedback3 = ""
feedback4 = ""
if (checkvar1.get() == "1"):
feedback1 = "Excellent"
if (checkvar2.get() == "1"):
feedback2 = "Good"
if (checkvar3.get() == "1"):
feedback2 = "Average" if (checkvar4.get() == "1"):
feedback2 = "Poor"
feedback5 = feedback1 + " " + feedback2 + " " + feedback3 + " " + feedback4
conn = sqlite3.connect("Restaurant.db")
30
cursor = conn.cursor()
cursor.execute("INSERT INTO FEEDBACK VALUES ('" + n + "','" + eid + "','" +
def cancel():
feed.destroy()
# label#
fg="black").pack(side=TOP)
# name
, bg="white", justify='right',
textvariable=name).place(x=15, y=185)
31
insertwidth=2,
bg="white", justify='right',
textvariable=email).place(x=285, y=185)
###checkbutton
c2.deselect()
c2.place(x=120, y=265)
c3.place(x=220, y=265)
c4 = Checkbutton(feed, font=('Calibri', 10, "bold"),
text=" Poor ", bg="white", variable=checkvar4, )
# comments"
commentslbl = Label(feed, font=('Calibri', 15),
txt.place(x=15, y=335)
32
# button
# Feedbackbutton
pady=10, width=10,
command=feedbackk).grid(row=8, column=2, columnspan=1)
lblinfo.grid(row=0, column=0)
33
lblpriceb = Label(roott, font=("Calibri", 20, "bold"), text="125/-", fg="blue",
bd=10) lblpriceb.grid(row=3, column=3)
lblicecream = Label(roott, font=("Calibri", 20, "bold"), text="Ice-Cream",
fg="Blue", bd=10) lblicecream.grid(row=4, column=0)
# menubutton
pady=6, width=12,
command=menu).grid(row=2, column=2)
root.mainloop()
system()
34
OUTPUT
35
OUTPUT
36
OUTPUT
37
Analysis
38
BIBLIOGRAPHY
Stationary refered:
Computer Science With PYTHON By Sumita
Arora Websites:
https://docs.python.org/3/tutorial.com
https://www.w3school.com/python/.com
40
CONCLUSION
39