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

Project Vasu (1)

Uploaded by

lakshmideva3231
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)
29 views

Project Vasu (1)

Uploaded by

lakshmideva3231
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
You are on page 1/ 27

MAMTA MODERN SR. SEC.

SChOOl

ClASS XII pROjECT fIlE

COMpuTER SCIENCE (083)

NAME: VASu AggARwAl


ClASS: XII-A
ROll NO: 26642498
SESSION: 2023-24
INDEX
• ACkNOwlEDgEMENT

• CERTIfICATE

• AbSTRACT

• INTRODuCTION

• ObjECTIVES

• SOuRCE CODE

• SySTEM SOuRCES
ACkNOwlEDgEMENT
Apart from the efforts by us, the success of any project depends
largely on the encouragement and guidelines of many others. I take
this opportunity to express my gratitude to the people who have
been instrumental in the successful completion of this project.

We express a deep sense of gratitude to almighty God for giving me


strength for the successful completion of the project.

We express our heartfelt gratitude to our parents for their constant


encouragement while carrying out this project.

We gratefully acknowledge the contribution of the individuals who


contributed in bringing this project up to this level, and who continue
to look after me despite my flaws.

We express our deep sense of gratitude to the luminary The


Principal, Mamta Modern Senior Secondary School who has been
continuously motivating and extending their helping hand to us.

We sincerely thank Mrs. Mohini Batra, the Teacher in charge, A


guide, a Mentor, all above a friend, who critically reviewed my
project and helped in solving every problem, that occurred during
the implementation of the project.

The guidance and support received from all the members who
contributed and who are contributing to this project was vital for the
success of the project. I am grateful for their constant support and
help
CERTIfICATE
This is hereby to certify that the original and
genuine work has been carried out to complete
the project work and the related codes and output
have been completed sincerely and satisfactorily
by Vasu Aggarwal of class XII-A, Mamta Modern
Sr. Sec. School, regarding her project titled
“Grocery Management”.

_____________________ ______________________

Internal Signature External Signature


AbSTRACT
The main objective of this grocery management system
which is developed in Python is to provide a flexible
solution for the grocery store. With this system, the
admin of the particular grocery store will find it easy to
manage and perform all operations using the system.
This system enables the admin to work on the data
related to items in the store, staff working there and
customers visiting. Admin of the grocery store can
make corrections or operations required within the
management system. The operations that can be
performed by admin are: Registering new
customer/staff/item details, Updating the details of the
existing customers/staff/items, Deleting the previous
records, searching a record, and displaying all the
existing records. Its user-friendly graphical mode will
make its users work with this new system in a more
interactive way
INTRODuCTION
This project is based on the management of grocery
store, such as information about the customers such as
their Name, Contact No, address etc. This information
can be stored in the data and can be verified whenever
we want. This computer program can be used for any
type of store where the admin has to work with the
staff, customer and item details.
ObjECTIVE
The objective of this project is to let the students apply
their programming knowledge to a real-world
situation/problem and expose the students to how
programming skills help in developing good software.
1. Write programs utilizing modern software tools.
2. Apply object-oriented programming principles
effectively when developing small to medium-sized
projects.
3. Write effective procedural code to solve small to
medium-sized problems.
4. Students will demonstrate a breadth of knowledge in
computer science, as exemplified in the areas of
systems, theory and software development.
SOuRCE CODE
print("_______WELCOME TO GROCERY STORE :)_________")
loginid=input("enter the login id")
password=input("enter the password")
if loginid=="grocery@admin" and password=="123456":
print("login id and password are correct")
print(" ---------------------------------------------------------")
print("Enter 1 for customer details")
print(" ---------------------------------------------------------")
print("Enter 2 for staff details")
print(" ---------------------------------------------------------")
print("Enter 3 for item details")
print(" ---------------------------------------------------------")
ch=int(input("enter your choice"))
def customer():
print("_____WELCOME TO GROCERY STORE :)______")
print(" ---------------------------------------------------------")
print("Enter 1 to display the customer record")
print(" ---------------------------------------------------------")
print("Enter 2 to search the customer record")
print(" ---------------------------------------------------------")
print("Enter 3 to update a customer record")
print(" ---------------------------------------------------------")
print("Enter 4 to insert a customer record")
print(" ---------------------------------------------------------")
print("Enter 5 to delete a customer record")
print("---------------------------------------------------------")
ch=int(input("enter your choice"))
def display():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
mycursor.execute("select * from customer")
mydata=mycursor.fetchall()
for i in mydata:
print(i)
def insert():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print ("welcome to customer data entry :)")
ans="y"
bonus_points=0
while ans=="y":
cust_id=int(input("enter customer id"))
name=input("enter customer name")
mob_no=input("enter customers mobile no")
address=input("enter customer address")
amount=int(input("enter amount"))
if amount>=2000:
bonus_points=bonus_points+100
else:
bonus_points=bonus_points
query="insert into customer
values({0},'{1}','{2}','{3}',{4},{5})".format(cust_id,name,mob_no,address,amount,bonus_point
s)
mycursor.execute(query)
mycon.commit()
print("******record saved.......*******")
ans=input("add more?")
def update():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print("welcome to customer update screen :)")
cust_id=int(input("enter customer id"))
query="select * from customer where cust_id={}".format(cust_id)
mycursor.execute(query)
data=mycursor.fetchone()
if data!=None:
print("## record found- details are##")
print(data)
ans=input("are you sure to update amount: (y/n)")
if ans=="y":
s=int(input("enter new amount"))
query="update customer set amount={} where cust_id={}".format(s,cust_id)
mycursor.execute(query)
mycon.commit()
print("## record updated")
else:
print("sorry! no such customer id exists :(")
def search():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print("welcome to customer search screen :)")
cust_id=int(input("enter customer id"))
query="select * from customer where cust_id={}".format(cust_id)
mycursor.execute(query)
data=mycursor.fetchone()
if data!=None:
print("## record found- details are##")
print(data)
else:
print("sorry! no such customer id exists :(")
def delete():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print("welcome to customer record delete screen :)")
delete="y"
while delete=="y":
c=int(input("enter cutomer id to delete"))
query="delete from customer where cust_id='%s';"%(c,)
mycursor.execute(query)
mycon.commit()
print("customer record deleted")
delete=input("do you want to delete more customer records(y/n)")
if ch==1:
display()
elif ch==4:
insert()
elif ch==3:
update()
elif ch==2:
search()
elif ch==5:
delete()
def item():
print("______WELCOME TO GROCERY STORE :)_______")
print(" ---------------------------------------------------------")
print("Enter 1 to display the item record")
print(" ---------------------------------------------------------")
print("Enter 2 to search the item record")
print(" ---------------------------------------------------------")
print("Enter 3 to update a item record")
print(" ---------------------------------------------------------")
print("Enter 4 to insert a item record")
print(" ---------------------------------------------------------")
print("Enter 5 to delete a item record")
print(" ---------------------------------------------------------")
ch=int(input("enter your choice"))
def display():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
mycursor.execute("select * from items")
mydata=mycursor.fetchall()
for i in mydata:
print(i)
def insert():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print ("welcome to item data entry :)")
ans="y"
bonus_points=0
while ans=="y":
item_name=input("enter item name")
item_code=int(input("enter item code"))
company_name=input("enter company_name")
quantity=int(input("enter item quantity"))
price=int(input("enter total item price"))
query="insert into items
values('{0}',{1},'{2}',{3},{4})".format(item_name,item_code,company_name,quantity,price)
mycursor.execute(query)
mycon.commit()
print("##record saved.......##")
ans=input("add more?")
def update():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print("welcome to item update screen :)")
item_code=int(input("enter item code"))
query="select * from items where item_code={}".format(item_code)
mycursor.execute(query)
data=mycursor.fetchone()
if data!=None:
print("## record found- details are##")
print(data)
ans=input("are you sure to update quantity: (y/n)")
if ans=="y":
s=int(input("enter new quantity"))
query="update customer set quantity={} where item_code={}".format(s,item_code)
mycursor.execute(query)
mycon.commit()
print("## record updated")
else:
print("sorry! no such customer id exists :(")
def search():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print("welcome to item search screen :)")
item_code=int(input("enter item code"))
query="select * from items where item_code={}".format(item_code)
mycursor.execute(query)
data=mycursor.fetchone()
if data!=None:
print("## record found- details are##")
print(data)
else:
print("sorry! no such item id exists :(")

def delete():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print("welcome to items record delete screen :)")
delete="y"
while delete=="y":
c=int(input("enter item_code to delete"))
query="delete from items where item_code='%s';"%(c,)
mycursor.execute(query)
mycon.commit()
print("item record deleted")
delete=input("do you want to delete more item records(y/n)")
if ch==1:
display()
elif ch==4:
insert()
elif ch==3:
update()
elif ch==2:
search()
elif ch==5:
delete()
def staff():
print("_______WELCOME TO GROCERY STORE :)________")
print(" ---------------------------------------------------------")
print("Enter 1 to display the staff record")
print(" ---------------------------------------------------------")
print("Enter 2 to search the staff record")
print(" ---------------------------------------------------------")
print("Enter 3 to update a staff record")
print(" ---------------------------------------------------------")
print("Enter 4 to insert a staff record")
print(" ---------------------------------------------------------")
print("Enter 5 to delete a staff record")
print(" ---------------------------------------------------------")
ch=int(input("enter your choice"))
def display():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
mycursor.execute("select * from staff")
mydata=mycursor.fetchall()
for i in mydata:
print(i)
def insert():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print ("welcome to staff data entry :)")
ans="y"
bonus_points=0
while ans=="y":
staff_code=int(input("enter staff code"))
staff_name=input("enter staff name")
staff_department=input("enter staff department")
salary=int(input("enter salary"))
address=input("enter the staff address")
query="insert into staff
values({0},'{1}','{2}',{3},'{4}')".format(staff_code,staff_name,staff_department,salary,address)
mycursor.execute(query)
mycon.commit()
print("##record saved.......##")
ans=input("add more?(y/n)")
def update():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print("welcome to staff record update screen :)")
staff_code=int(input("enter staff code"))
query="select * from staff where staff_code={}".format(staff_code)
mycursor.execute(query)
data=mycursor.fetchone()
if data!=None:
print("## record found- details are##")
print(data)
ans=input("are you sure to update salary: (y/n)")
if ans=="y":
s=int(input("enter new salary"))
query="update staff set salary={} where staff_code={}".format(s,staff_code)
mycursor.execute(query)
mycon.commit()
print("## record updated")
else:
print("sorry! no such customer id exists :(")
def search():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print("welcome to staff record search screen :)")
staff_code=int(input("enter staff code"))
query="select * from staff where staff_code={}".format(staff_code)
mycursor.execute(query)
data=mycursor.fetchone()
if data!=None:
print("## record found- details are##")
print(data)
else:
print("sorry! no such item id exists :)")

def delete():
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='12345',database='grocery')
mycursor=mycon.cursor()
print("welcome to staff record delete screen :)")
delete="y"
while delete=="y":
c=int(input("enter staff_code to delete"))
query="delete from staff where staff_code='%s';"%(c,)
mycursor.execute(query)
mycon.commit()
print("staff record deleted")
delete=input("do you want to delete more staff records(y/n)")
if ch==1:
display()
elif ch==4:
insert()
elif ch==3:
update()
elif ch==2:
search()
elif ch==5:
delete()
if ch==1:
customer()
elif ch==2:
staff()
elif ch==3:
item()
else:
print("incorrect id or password")

OUTPUTS
Entering into the grocery store database with the
id/password

Displaying all the existing records of customers visited


Searching a customer record with customer id

Updating a customer record


Inserting a customer record

Deleting a customer record


Displaying all the records of staff working in the store

Searching a staff record


Updating a staff record

Deleting a staff record


Inserting a staff record

Displaying all the items stored


Searching item record in a store

Deleting an item record


Updating an item record

Inserting an item record


SOfTwARE REQuIREMENTS
fOR pROjECT
1. OPERATING SYSTEM: WINDOWS 10
2. SOFTWARE FOR PYTHON: IDLE 3.9 64-bit
3. SOFTWARE FOR MYSQL: MYSQL 8.0

bIblIOgRAphy
● COMPUTER SCIENCE WITH PYTHON: CLASS XII-PREETI ARORA.
● PYTHON4CSIP.COM SAMPLE PROJECTS

You might also like