Anirudh CS Project 2022-23 Class Xii (F) - 1
Anirudh CS Project 2022-23 Class Xii (F) - 1
Anirudh CS Project 2022-23 Class Xii (F) - 1
PALLAVUR
PROJECT REPORT ON
COFFEE SHOP MANAGEMENT
AS PART OF COMPUTER SCIENCE [083]
CLASS XII
This is to certify that the Computer Science Project work title “coffee
shop management system” is a bonafide work done by Anirudh
Ajithkumar of class XII of Chinmaya Vidyalaya Pallavur under the
guidance and supervision of Mrs K.Usha Baburaj during the academic
year 2022-23.
Signature of Signature of
Signature of Principal
ACKNOWLEDGEMENT
IMPLEMENTATION
OUTPUT SCREENSHOTS
LIMITATIONS
BIBILOGRAPHY
ABOUT THE PROJECT
PYTHON
Python is a general-purpose programming language that can be used
on any modern computer operating system. It can be used for
processing text, numbers, images, scientific data and just about
anything else you might save on a computer. It is used daily in the
operations of the Google search engine, the video-sharing website
YouTube, NASA and the New York Stock Exchange.
1) mysql.connector
MySQL Connector module of Python is used to connect MySQL
databases with the Python programs, it does that using the Python
Database API Specification v2.0 (PEP 249). It uses the Python
standard library and has no dependencies.
2) time
As the name suggests Python time module allows to work with time
in Python. It allows functionality like getting the current time, pausing
the Program from executing, etc. So before starting with this module
we need to import it.
IMPLEMENTATION
SOURCE CODE:
import mysql.connector as sq
import time
con =
sq.connect(host='localhost',database='coffee_shop',user='root',passwo
rd='sqliscool')
print( '''
_______ _ _ ______ ____ ______ _ _ ______ _______ __
''')
def welcome():
while True:
print('''\nWhat is that you wish to do :
def buyitems():
buyout = []
gp = 0
p=0
c1 = con.cursor()
c1.execute('select * from ITEMS ')
itemlist = c1.fetchall()
print('\n--------------- MENU ----------------\n')
print('ITEM_NO ITEM_NAME PRICE')
print('======= ========= =====')
for a in itemlist:
print(str(a[0])+" "*(18-len(str(a[0])))+a[1] +" "*(20-len(str(a[1])))
+str(a[2]),"\n")
op = 'y'
while op == 'y':
i_no = input('Enter item no : ')
i_q = int(input('Enter the quantity : '))
priceq = 'select PRICE from ITEMS where ITEMID ='+i_no
c1.execute(priceq)
priceitem = c1.fetchone()
itemq = 'select ITEMNAME from ITEMS where ITEMID ='+i_no
c1.execute(itemq)
itemname = c1.fetchone()
for f_price in priceitem:
final_price = int(f_price)
for f_item in itemname:
final_item = f_item
p=p+1
buyout = buyout + [[p,final_item ,i_q, final_price*i_q]]
gp = final_price*i_q + gp
op = input('Do you wish to continue buying (y/n) : ')
billc = input('Do you wish to proceed to pay the bill (y) or cancel the order
(n) : ')
if billc == 'y':
billing(buyout,gp)
else:
message()
def billing(ordered,gp):
buyout_price = 0
print('Your bill : - \n')
print('NO ITEM QUANTITY PRICE')
print('== ==== ======== =====')
for a in ordered:
print(str(a[0])+" "*(12-len(str(a[0])))+a[1] +" "*(16-len(str(a[1])))
+str(a[2])+" "*(18-len(str(a[2])))+str(a[3]),"\n")
1)Paytm
2)Cash
3)Card
def adding_customer(name,pay,amount,payment_stat):
c2 = con.cursor()
c2.execute('select max(ID) from customer_info')
itemlist2 = c2.fetchall()
for l in itemlist2:
for k in l:
if k == None:
id = 0
qry = 'insert into customer_info values(%s,%s,%s,%s,%s)'
val = (id+1,name,amount,pay,payment_stat)
c2.execute(qry,val)
con.commit()
else:
qry = 'insert into customer_info values(%s,%s,%s,%s,%s)'
val = (k+1,name,amount,pay,payment_stat)
c2.execute(qry,val)
con.commit()
def login():
pwd = input('Enter the password : ')
if pwd == 'admin123':
admin()
else:
print('\nIncorrect password.......ACCESS DENIED\n')
def admin():
print('\nWELCOME ADMINISTRATOR\n')
p = int(input('''
SELECT THE OPTION YOU WISH TO DO
if p == 1:
update_e()
elif p == 2:
add_e()
elif p == 3:
remove_e()
elif p == 4:
add_item()
elif p == 5:
up_item()
elif p == 6:
customer_details_list()
else:
print('invalid input')
def update_e():
c3 = con.cursor()
c3.execute('select * from employee_detail')
elist3 = c3.fetchall()
print('ID NAME SALARY')
print('== ==== ======')
for a in elist3:
print(str(a[0])+" "*(12-len(str(a[0])))+a[1] +" "*(15-len(str(a[1])))
+str(a[2]),"\n")
def add_e():
c4 = con.cursor()
c4.execute('select max(ID) from employee_detail')
itemlist4 = c4.fetchall()
name = input('Enter the employee name : ')
sal = int(input('Enter the employee salary : '))
for l in itemlist4:
for k in l:
if k == None:
id = 0
qry = 'insert into
employee_detail(ID,EMPLOYEE_NAME,SALARY) values(%s,%s,%s)'
val = (id+1,name,sal)
c4.execute(qry,val)
con.commit()
else:
qry = 'insert into
employee_detail(ID,EMPLOYEE_NAME,SALARY) values(%s,%s,%s)'
val = (k+1,name,sal)
c4.execute(qry,val)
con.commit()
print('New employee destails added successfully')
def remove_e():
c6 = con.cursor()
c6.execute('select * from employee_detail')
elist6 = c6.fetchall()
print('ID NAME SALARY')
print('== ==== ======')
for a in elist6:
print(str(a[0])+" "*(12-len(str(a[0])))+a[1] +" "*(15-len(str(a[1])))
+str(a[2]),"\n")
s = input('Enter employee id to be deleted : ')
qry = 'delete from employee_detail where id ='+s
c6.execute(qry)
con.commit()
print('Employee detail removed successfully')
def add_item():
c8 = con.cursor()
c8.execute('select max(ITEMID) from items ')
itemlist8 = c8.fetchall()
name = input('Enter the item name : ')
price = int(input('Enter the item price : '))
for l in itemlist8:
for k in l:
if k == None:
id = 0
qry = 'insert into ITEMS(ITEMID,ITEMNAME,PRICE) values(%s,
%s,%s)'
val = (id+1,name,price)
c8.execute(qry,val)
con.commit()
else:
qry = 'insert into ITEMS(ITEMID,ITEMNAME,PRICE) values(%s,
%s,%s)'
val = (k+1,name,price)
c8.execute(qry,val)
con.commit()
print('ITEM ADDED SUCCESSFULLY')
def up_item():
c10 = con.cursor()
c10.execute('select * from items')
ilist10 = c10.fetchall()
print('ITEM_NO ITEM_NAME PRICE')
print('======= ========= =====')
for a in ilist10:
print(str(a[0])+" "*(18-len(str(a[0])))+a[1] +" "*(20-len(str(a[1])))
+str(a[2]),"\n")
def customer_details_list():
c11 = con.cursor()
c11.execute('select * from customer_info')
clist11 = c11.fetchall()
print('\n')
print('ID NAME AMOUNT PAYMENT_MODE
PAYMENT_STATUS')
print('== ==== ====== ============
==============\n')
for a in clist11:
print(str(a[0])+" "*(12-len(str(a[0])))+a[1] +" "*(16-len(str(a[1])))
+str(a[2])+" "*(18-len(str(a[2])))+str(a[3])+" "*(22-len(str(a[3])))+str(a[4]) ,"\
n")
def message():
print('''
''')
welcome()
OUTPUT SCREENSHOTS
1)HOME PAGE
2)ITEMS MENU
3)ORDERING ITEMS
4)BILLING / CHECKOUT
5)CANCELLING ORDER
6)ADMININSTRATOR LOGIN
BIBILOGRAPHY
https://www.geeksforgeeks.org/
https://www.python.org/
https://www.mysql.com/
NCERT Computer Science Textbook for Class XII
Sumita Arora Computer Science With Python Class 12th