Anirudh CS Project 2022-23 Class Xii (F) - 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 26

CHINMAYA VIDYALAYA

PALLAVUR

PROJECT REPORT ON
COFFEE SHOP MANAGEMENT
AS PART OF COMPUTER SCIENCE [083]
CLASS XII

Submitted by: Submitted to:


Anirudh Ajith Mrs.K.Usha Baburaj
CERTIFICATE

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

INTERNAL EXAMINER EXTERNAL EXAMINER

Signature of Principal
ACKNOWLEDGEMENT

I would specially thank Mrs K .Usha Baburaj, our Computer


Science teacher for providing her valuable guidance,
suggestions and comments throughout the course of project.

I would also like to express my sincere gratitude to our


Principal Mr. Jayan Kambrath for providing an opportunity
to work of investigatory project on the topic “coffee shop
management system”
TABLE OF CONTENTS

 ABOUT THE PROJECT

 SHORT DESCRIPTION OF THE MODULES

 IMPLEMENTATION

 OUTPUT SCREENSHOTS

 LIMITATIONS

 BIBILOGRAPHY
ABOUT THE PROJECT

Coffee shop management system is a command line interface


developed for the effortless management of customers in a
coffee shop. The program intents to reduce the workload on
the employees and accelerate the workflow for time-
management. It is a user-friendly program that is solely
dedicated to gain approval of the customers for its easy to
understand user interface.
Here the coffee shop named ‘Beanery’ is used as an example.
The program provides both customer and administration
management. This program allows customers to place their
orders and retrieve the bill (customer management).
Administrators can manage the details of the employees
working in the coffee shop (administrator management).
SHORT DESCRIPTION OF THE MODULES

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( '''
_______ _ _ ______ ____ ______ _ _ ______ _______ __

|__ __| | | | ____| | _ \| ____| /\ | \ | | ____| __ \ \ / /

| | | |__| | |__ | |_) | |__ / \ | \| | |__ | |__) \ \_/ /

| | | __ | __| | _ <| __| / /\ \ | . ` | __| | _ / \ /

| | | | | | |____ | |_) | |____ / ____ \| |\ | |____| | \ \ | |

|_| |_| |_|______| |____/|______/_/ \_\_| \_|______|_| \_\ |_|

''')

print('Welcome to house of espressos,cold coffee and many more\n')

def welcome():
while True:
print('''\nWhat is that you wish to do :

1)GRAB A DRINK OR A BITE


2)ADMIN LOGIN
\n ''')

j = int(input('''ENTER YOUR OPTION ------> '''))


if j == 1:
buyitems()
elif j == 2:
login()
else:
print('Invalid input')

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

print('GRAND TOTAL = ',gp)


name = input('Please enter your name : - ')

paymode = int(input('''Enter the mode of payment

1)Paytm
2)Cash
3)Card

Enter your option ----> '''))


if paymode == 1:
pay = 'Paytm'
print('Please wait while we confirm your transaction.....')
time.sleep(2)
print('\nYour Paytm transaction has been succesfull')
elif paymode == 2:
pay = 'Cash'
print('\nYour purchase is successfull')
else:
pay = 'Card'
print('Please wait while we process your transaction.....')
time.sleep(2)
print('\nYour transaction has been succesfull')
payment_stat = 'success'
adding_customer(name,pay,gp,payment_stat)
message()

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

1)UPDATE STAFF SALARY


2)ADD STAFF DETAILS
3)REMOVE STAFF
4)ADD NEW ITEMS TO THE MENU
5)UPDATE ITEM PRICE
6)VIEW CUSTOMER INFO

ENTER YOUR OPTION -----> '''))

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

e = int(input('Enter the employee id no : '))


s = int(input('Enter the new salary = '))
qry = 'update employee_detail set salary = %s where id = %s'
val = (s,e)
c3.execute(qry,val)
con.commit()
print('Salary updated successfully')

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

e = int(input('Enter the item id no : '))


s = int(input('Enter the new price = '))
qry = 'update items set price = %s where itemid = %s'
val = (s,e)
c10.execute(qry,val)
con.commit()
print('price updated successfully')

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('''

THANK YOU FOR SHOPPING WITH US

PLEASE VISIT US AGAIN 🙏

''')
welcome()

OUTPUT SCREENSHOTS
1)HOME PAGE

2)ITEMS MENU

3)ORDERING ITEMS
4)BILLING / CHECKOUT

5)CANCELLING ORDER
6)ADMININSTRATOR LOGIN

7)UPDATING EMPLOYEE SALARY


8)ADDING NEW EMPLOYEE’S DETAILS

9)REMOVING EMPLOYEE DETAILS


10)ADDING NEW ITEM TO THE MENU

11)UPDATING ITEM PRICE


12)VIEWING CUSTOMER DETAILS

13)INCORRECT CREDENTIALS FOR ADMIN LOGIN


LIMITATIONS
“It's hard enough to find an error in your code when you're looking
for it; it's even harder when you've assumed your code is error-
free.”
- Steve McConnell

The limitations of the program include:

The program does not offer a GUI (Graphical User Interface)


As the program is built on a Python platform , the compilation
and execution is quite slow compared to other languages lie C ,
C++ etc.

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

You might also like