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

Bakery Management System Project Python and SQL

Uploaded by

neildua0704
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)
110 views

Bakery Management System Project Python and SQL

Uploaded by

neildua0704
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/ 22

lOMoARcPSD|50675538

Bakery Management system Project -Python and SQL

computer Science engineering (Maharaja Agrasen Institute Of Technology)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Neil Dua ([email protected])
lOMoARcPSD|50675538

PROJECT WORK

SOFTWARE- PYTHON AND


MY SQL

TOPIC- BAKERY BILLING


MANAGEMENT SYSTEM

1|Page

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

INDEX

S NO. DESCRIPTION PAGE NO.

1 ACKNOWLEDGEMENT 4

2 INTRODUCTION AND 5
OBJECTIVE OF THE
PROJECT
3 HARDWARE AMD 6
SOFTWARE
REQUIREMENTS

4 PROPOSED SYSTEM 7

5 MY SQL DATABASE 8
TABLE- SCHOOLBAKERY

6 SOURCE CODE AND 9-21


OUTPUT

7 BIBLIOGRAPHY 22

2|Page

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

ACKNOWLEDGEMENT

Apart from the efforts of me, 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.
I express deep sense of gratitude to almighty God for
giving me strength for the successful completion of
the project.
I express my heartfelt gratitude to my parents for
constant encouragement while carrying out this
project.
I gratefully acknowledge the contribution of the
individuals who contributed in bringing this project up
to this level, who continues to look after me despite
my flaws,
My sincere thanks to ______ Master In-charge, A guide,
Mentor all the above a friend, who critically reviewed
my project and helped in solving each and every
problem, occurred during 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.

3|Page

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

PROJECT ON BAKERY BILLING


MANAGEMENT SYSTEM
INTRODUCTION-
This programme helps user to generate a bill of
his/her bakery account.
It gives the whole menu of a bakery and ask user
to select one or more item and and then it shows
total bill with granted discount.
Allow user to add or delete item pieces from
menu and gives output.

OBJECTIVE OF THIS PROJECT-


The objective of this project is to let the
students apply the programming knowledge into
a real- world situation/problem and exposed the
students how programming skills helps in
developing a good software.
1. Write programs utilizing modern software
tools
2. Write effective procedural code to solve
small to medium size projects.
3. Students will demonstrate ability to
conduct a research or applied Computer
Science project, requiring writing and
presentation skills which exemplify
scholarly style in computer science.

4|Page

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

HARDWARE AND SOFTWARE


REQUIREMENTS

I.OPERATING SYSTEM : WINDOWS 7 AND ABOVE


II. PROCESSOR : PENTIUM(ANY) OR AMD
ATHALON(3800+- 4200+ DUALCORE)
III. MOTHERBOARD : 1.845 OR 915,995 FOR
PENTIUM 0R MSI K9MM-V VIAK8M800+8237R
PLUS CHIPSET FOR AMD ATHALON
IV. RAM : 512MB+
V. Hard disk : SATA 40 GB OR ABOVE
VI. CD/DVD r/w multi drive combo: (If back up
required)
VII. FLOPPY DRIVE :1.44 MB (If Backup
required)
VIII. MONITOR :14.1 or 15 -17 inch
IX. Key board and mouse
X. Printer : (if print is required –
[Hard copy])
SOFTWARE REQUIREMENTS:
I. Windows OS
II. Python
III. MySQL

5|Page

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

PROPOSED SYSTEM
Today one cannot afford to rely on the fallible
human beings of be really wants to stand against
today’s merciless competition where not to wise
saying “to err is human” no longer valid, it’s out-
dated to rationalize your mistake. So, to keep
pace with time, to bring about the best result
without malfunctioning and greater efficiency so
to replace the unending heaps of flies with a
much sophisticated hard disk of the computer.
One has to use the data management software.
Software has been an ascent in atomization
various organisations. Many software products
working are now in markets, which have helped
in making the organizations work easier and
efficiently. Data management initially had to
maintain a lot of ledgers and a lot of paperwork
has to be done but now software producton this
organization has made their work faster and
easier. Now only this software has to be loaded
on the computer and work can be done.
This prevents a lot of time and money. The work
becomes fully automated and any information
regarding the organization can be obtained by
clicking the button. Moreover, now it’s an age of
computers of and automating such an
organization gives the better look.

6|Page

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

MY SQL DATABASE TABLE-


SCHOOLBAKERY

7|Page

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

SOURCE CODE
ADD OR DELETE ITEM PIECES FROM DATABASE
import mysql.connector

# Connect to the database


cnx = mysql.connector.connect(user='root',
password='Eren@mikasa',
host='localhost',
database='project')

# Create a cursor
cursor = cnx.cursor()

cursor.execute("SELECT * FROM schoolbakery")

# Iterate through the result set


for (itemno, item, pieces, price, type) in cursor:
# Print the itemno, item, pieces, price, and type
print(f"Item Number: {itemno}, Item: {item}, Pieces:
{pieces}, Price: ${price}, Type: {type}")

while True:

8|Page

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

# Ask the user if they want to add or delete pieces


action = input("Do you want to add or delete pieces?
(add/delete): ")

# Get the item name and number of pieces from the user
item = input("Enter the item name: ")
pieces = int(input("Enter the number of pieces: "))

if action == "add":
# Add the specified number of pieces to the item in the
database
cursor.execute("UPDATE schoolbakery SET pieces =
pieces + %s WHERE item = %s", (pieces, item))
cnx.commit()
print("Pieces added successfully!")
elif action == "delete":
# Delete the specified number of pieces from the item in
the database
cursor.execute("UPDATE schoolbakery SET pieces =
pieces - %s WHERE item = %s", (pieces, item))
cnx.commit()
print("Pieces deleted successfully!")
else:

9|Page

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

print("Invalid action, please enter 'add' or 'delete'.")

# Ask the user if they want to continue


choice = input("Do you want to continue? (yes/no): ")
if choice.lower() != "yes":
break

10 | P a g e

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

ADDING ITEMS TO THE CART AND GETTING TOTAL


PRICE

cursor.execute("SELECT * FROM schoolbakery")

for (itemno, item, pieces, price, type) in cursor:


print(f"Item Number: {itemno}, Item: {item}, Pieces:
{pieces}, Price: ${price}, Type: {type}")

# Initialize total cost


total_cost = 0

while True:
# Ask the user if they want to add an item to the cart
choice = input("Do you want to add an item to the
cart? (yes/no): ")
if choice.lower() == "yes":
# Get the item name and number of pieces from the
user
item = input("Enter the item name: ")
pieces = int(input("Enter the number of pieces: "))

11 | P a g e

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

# Get the price of the item


cursor.execute("SELECT price FROM schoolbakery
WHERE item = %s", (item,))
price = cursor.fetchone()[0]

# Update the pieces in the database


cursor.execute("UPDATE schoolbakery SET pieces
= pieces - %s WHERE item = %s", (pieces, item))
cnx.commit()

# Print the item name, number of pieces, and price


print(f"Item: {item}, Pieces: {pieces}, Price:
${price}")

# Calculate the total cost


total_cost += pieces * price
else:
break
# Print the total cost
print(f"Total cost: ${total_cost}")
12 | P a g e

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

13 | P a g e

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

IF USER BUYS MORE THAN 3 ITEM HE GETS DISCOUNT


OF 20%

cursor.execute("SELECT * FROM schoolbakery")

for (itemno, item, pieces, price, type) in cursor:


print(f"Item Number: {itemno}, Item: {item}, Pieces:
{pieces}, Price: ${price}, Type: {type}")

cart_items = []
total_price = 0

while True:
# Ask the user if they want to add an item to the cart
action = input("Do you want to add an item to the
cart? (yes/no): ")

if action.lower() == "yes":
# Get the item name and quantity from the user
item = input("Enter the item name: ")

14 | P a g e

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

quantity = int(input("Enter the number of pieces:


"))

# Get the price of the item from the database


cursor.execute("SELECT price FROM schoolbakery
WHERE item = %s", (item,))
price = cursor.fetchone()[0]

# Add the item and its price to the cart


cart_items.append((item, quantity, price))
total_price += quantity * price

print(f"{quantity} pieces of {item} added to the


cart.")
elif action.lower() == "no":
break
else:
print("Invalid input. Please enter 'yes' or 'no'.")

# check if the user has added more than 3 items


if len(cart_items) > 3:
15 | P a g e

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

# Apply a 20% discount on the total price


total_price = total_price * 0.8
print("You have added more than 3 items, so you get
a 20% discount.")

# Print the items in the cart and the total price


print("\nItems in the cart:")
for item in cart_items:
print(f"{item[0]} ({item[1]} pieces)")
print(f"\nTotal price: ${total_price}")

16 | P a g e

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

17 | P a g e

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

IDENTTIFY THE TYPE OF DEESSERT USER IS CHOOSING

cursor.execute("SELECT * FROM schoolbakery")

for (itemno, item, pieces, price, type) in cursor:


print(f"Item Number: {itemno}, Item: {item}, Pieces:
{pieces}, Price: ${price}, Type: {type}")

while True:
# Get the item name from the user
item = input("Enter the item name: ")

# Get the type of the item from the database


cursor.execute("SELECT type FROM schoolbakery
WHERE item = %s", (item,))
item_type = cursor.fetchone()

if item_type:

# Print the type of the item


print(f"The type of {item} is {item_type[0]}")
18 | P a g e

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

else:
print(f"Item not found in the database")
# Ask the user if they want to select more items
choice = input("Do you want to select more items?
(yes/no): ")
if choice.lower() != "yes":
break

19 | P a g e

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

# Close the cursor and the connection


cursor.close()
cnx.close()

20 | P a g e

Downloaded by Neil Dua ([email protected])


lOMoARcPSD|50675538

BIBLIOGRAPHY

• Computer science With Python - Class XI


and XII
• A Project Report On Bakery billing
management system
By : _____

21 | P a g e

Downloaded by Neil Dua ([email protected])

You might also like