Durva Mehta CS Project
Durva Mehta CS Project
1 Introduction 5
2 Requirements 6
3 Development Cycle 7
4 Source Code 9
5 Sample Output 12
6 Conclusion 16
7 Bibliography 17
4
Introduction
In today's fast-paced world, cafes have become more than just a place to enjoy a
cup of coffee; they have evolved into social hubs where people gather to work,
relax, and socialize. Managing a cafe efficiently to meet the diverse needs of
customers while maintaining profitability can be a daunting task. This is where
the Cafe Management System, developed using Python and SQL, comes into play.
In this report, we will provide an in-depth analysis of the Cafe Management System
project, outlining its objectives, scope, design, functionality, and implementation.
We will also delve into the technology stack and tools used to develop this system,
highlighting how Python and SQL have been utilized to create a seamless and
efficient cafe management experience.
5
Requirements
The requirements for this project include -
sno INT,
product_name VARCHAR(20),
cost INT
)”
6
Development Cycle
Phase 1: Planning
A. Database Design: Check that the requirements are met by the database
structure. Make any necessary modifications in light of this.
B. Functionality Specification: Documenting the expected behavior of a
program.
Phase 2: Implementation
I will be using functional programming throughout the implementation. The
following are key points kept in mind -
7
G. Order:
a. Allows the user to Order items from the Cafe and generates the bills
for the same.
b. Implemented under the function named - “order()”, which internally
calls the following functions -
i. items()
ii. coffee()
iii. bill(amount)
Phase 3: Testing
A. Test all functions and commands in the program manually to find any errors.
B. Check all corner cases and ensure code works for those.
8
Source Code
# Importing libraries
from tabulate import tabulate
import mysql.connector
# Connecting to MySQL
con = mysql.connector.connect(host="localhost", user="root",
password="admin")
cur = con.cursor()
cur.execute(
"create table if not exists branch_vadodara(sno int, product_name
varchar(20), cost int)"
)
cur.execute("create table if not exists coffee_type(sno int, coffee_name
varchar(20))")
if res == []:
cur.execute("insert into coffee_type values(1,'Espresso')")
cur.execute("insert into coffee_type values(2,'Cappuccino')")
cur.execute("insert into coffee_type values(3,'Latte')")
9
cur.execute("insert into coffee_type values(4,'Americano')")
cur.execute("insert into coffee_type values(5,'Mocha')")
con.commit()
# Order items
def order():
items()
x = int(input("\nEnter the S No. of the item you want to order:"))
if x == 1:
coffee()
y = int(input("\nEnter the S No. of the coffee you want to order:"))
cur.execute("select * from coffee_type where sno=%d" % (y))
res = cur.fetchall()
print("\nYou have ordered", res[0][1], "coffee\n")
10
cur.execute("select * from branch_vadodara where sno=%d" % (x))
res = cur.fetchall()
bill(res[0][2])
else:
cur.execute("select * from branch_vadodara where sno=%d" % (x))
res = cur.fetchall()
print("\nYou have ordered", res[0][1])
print("")
bill(res[0][2])
# Welcome code:
print("\t\t-----------------------------")
print("\t\t Welcome to Durva's Cafe!")
print("\t\t-----------------------------\n\n")
Main()
11
Sample Output
1. Welcome Prompt :
12
3. Selecting Option 2, Order :
Note: Outputs are similar for Order options 3, 4 and 5 i.e., Sandwich, Pasta and Pizza
respectively.
13
5. Selecting to Order option 1, Coffee :
Note: Outputs are similar for Coffee options 2, 3, 4 and 5 i.e., Cappuccino, Latte,
Americano and Mocha respectively.
14
7. Selecting option 3 in Main Prompt, Exit :
15
Conclusion
To sum up, the Cafe Management System (CMS) simplifies cafe management data
and boosts operational effectiveness, making it a crucial tool for contemporary
businesses. This system makes common cafe tasks like ordering, displaying the
menu, requesting client information, and printing the bill easier by utilizing Python
and a MySQL database.
Its intuitive interface makes it easier to use, which enhances productivity and
decision-making. As we come to the finish of this project, we see how it may
improve the management tasks that cafe attendants perform, making it an
invaluable resource for businesses.
16
Bibliography
A. Websites:
1. https://www.w3schools.com/python/
2. https://www.w3schools.com/python/python_mysql_getstarted.asp
3. https://pypi.org/project/mysql-connector-python/
B. Books:
1. Computer Science with Python Class - 12 by Sumita Arora
2. Computer Science with Python Class - 11 by Sumita Arora
17