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

Project File CS

Project file cs

Uploaded by

vaanyatrivedi11a
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Project File CS

Project file cs

Uploaded by

vaanyatrivedi11a
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

RYAN INTERNATIONAL SCHOOL

NOIDA EXTENSION
AY-2024-25

COMPUTER SCIENCE PROJECT FILE

SUBMITTED BY- SUBMITTED TO-


VAANYA TRIVEDI MS.PINKI MAHTO

CLASS- 12-A
ROLL NO- 41

1
ACKNOWLEDGEMENT
I would like to express a deep sense of thanks & gratitude to
my Computer Science teacher Ms. Pinki Mahto for guiding
me immensely through the course of the project. Madam has
always evinced keen interest in my work. Her constructive
advice & constant motivation have been responsible for the
successful completion of this project.

My sincere thanks go to Ms. Eram Abedi , our Principal ,


gave me all the required facilities, which also helped me in
doing a lot of research and I came to know about so many
new things.

I also thank my parents for their motivation ,support and


providing me with all the necessary resources.

Thank You

Vaanya Trivedi

2
CERTIFICATE

This is to certify that VAANYA TRIVEDI of class


XII , has prepared this report on the project
entitled “SUPER MARKET BILLING System”. This
report is the result of her efforts and endeavours.
The report is found worthy of acceptance as the
final report for the subject Computer Science
(083) of class XII. She has prepared the project
under my guidance.

Internal Examiner External Examiner

Principal

3
SUPERMARKET
BILLING
SYSTEM

4
OBJECTIVE

The Aim of this Project is to design a


Menu-driven Supermarket billing system for
billing the products This system is flexible and
secure. As the name of the project “Supermarket
Billing System” this system is used by Customers
to add the products available in the supermarket.

PROJECT SPECIFICATION:

The Super market Billing System has a unique


functionality as it is a menu driven program that
helps the user of the code, where the customers
can easily handle it. The main functions of this
system are:

5
1. Creating a new account (SIGN UP)
2. Login into account
3. Adding product details
4. To generate bill and amount
5. To check the purchase history of
all products
6. To get the customer feedback
7. To delete the product

6
SOFTWARE USED-
FRONT END:

This Project uses Python IDLE/IDE as the front-end


application. It uses Python Shell as a Menu Driven
Interface.

BACK END:

MySQL:
MySQL is an open-source ,relational database management
system (RDBMS) developed by Oracle Corporation. MySQL is
the world's most popular open-source database. With its
proven performance, reliability and ease-of-use, MySQL has
become the leading database choice for web based
applications, used by high profile web properties including
Facebook, Twitter, YouTube, Yahoo! and many more. This
Project uses MySQL database as the first back-end application
to store Supermarket Billing Details and is connected to the
front-end application.

7
MODULES USED-

1. MySQL.Connector Module:

The Module MySQL.Connector is a Python module that provides a


connection to a MySQL database using the MySQL Connector/Python
API. It allows Python programs to access and manipulate MySQL
databases with ease. This module supports various MySQL features
and provides an easy-to-use interface for performing database
operations such as querying, inserting, updating, and deleting data. In
this project, we imported:

import mysql.connector
Function Used:
a) db = mysql.connect(host="Localhost", user="root",
password="vaanya123", auth_plugin='mysql_native_password')
b) mycursor=mydb.cursor()
c) mycursor. execute()
d) mydb.commit()
e) data=mycursor.fetchall()
f) data=mycursor.fetchone()
g) mydb.Close()

2. Tabulate Module:
The tabulate is a popular Python library used to display the data in
tabular format. It takes structured data, such as lists of lists or
dictionaries, and formats it into a visually appealing table. In the

8
Project, this module is used to display the data retrieved from MySQL
tables in Tabular from. Function Used:

from tabulate import tabulate tabulate (data, Header,


tablefmt="simple_grid" )

9
Code-

#SOURCE CODE FOR SUPER MARKET BILLING SYSTEM


#SUPER MARKET BILLING SYSTEM

print("### WELCOME TO SUPER MARKET ###")


print("### WELCOME TO SUPER MARKET ###")

import mysql.connector
import tabulate as tb

mydb =
mysql.connector.connect(host="localhost",user="root",password="vaan
ya123",auth_plugin="mysql_native_password")
print(mydb)
mycursor=mydb.cursor()

#creating required Database and using it


mycursor.execute("create database if not exists supermarket")
mycursor.execute("use supermarket")

#creating required to create tables


mycursor.execute("create table if not exists user(user_id char(10)
primary key,name varchar(30),password char(20),phone_no
char(20))")
mycursor.execute("create table if not exists storeproducts(sid
char(20),pname char(70),price decimal(8,2),qty int,Total_price
decimal(8,2))")

mydb.commit()

10
while(True):
print("1-SIGNUP: ")
print("2-existing user: Please login")
print("3-Enter product information: ")
print("4-Generating bill report: ")
print("5-Customer feedback: ")
print("6-PURCHASE HISTORY")
print("7-DELETING the product")
ch=int(input("Enter your choice:"))

if(ch==1):
print("Please enter your user details-")
uid=input("Enter the user id:")
name=input("Enter your name: ")
password=input("Enter your password: ")
phone_no=input("Enter your phone number: ")
mycursor.execute("insert into user
values('"+uid+"','"+name+"','"+password+"','"+phone_no+"')")
mycursor.execute("create table if not exists "+uid+"(pname
char(20),price decimal(8,2),qty int,Total_price decimal(8,2))")
mydb.commit()
print("User Registration done successfully.")

# User Login
if (ch == 1):
print("Please enter your user details")
uid = input("Enter the user id:")
pwd = input("Enter the password:")

11
query = "select * from user where user_id='" + uid + "' and
password='" + pwd + "'"
mycursor.execute(query)
data = mycursor.fetchall()

if data != []:
print("User logged in successfully")
else:
print("User ID or Password Incorrect")

# Add Product
elif (ch == 2):
print("Please enter product details")
sid = input("Enter serial id:")
pname = input("Enter product name:")
price = float(input("Enter price:"))
qty = int(input("Enter the quantity:"))
total_price = price * qty

mycursor.execute("insert into storeproducts values('" + sid + "', '" +


pname + "', " + str(price) + ", " + str(qty) + ", " + str(total_price) + ")")
mycursor.execute("insert into cart values('" + pname + "', " +
str(price) + ", " + str(qty) + ", " + str(total_price) + ")")

print("Product added into cart succesfully")


mydb.commit()

# View Cart
elif (ch == 3):
uid = input("Enter the uid:")
mycursor.execute("select * from " + uid)

12
table_rows = mycursor.fetchall()
columns = ["pname", "price", "qty", "total_price"]
data = tabulate(table_rows, headers=columns,
tablefmt="simple_grid")

print(data)
print("**THANK YOU FOR SHOPPING**")
print("**BILL SUCCESSFULLY GENERATED**")

# Feedback
elif (ch == 4):
print("Customer feedback*************")
ch1 = int(input("Enter feedback about store and services OUT OF
10:"))
print(ch1)
print("THANK YOU FOR YOUR FEEDBACK")

# Generate Bill
elif (ch == 5):
mycursor.execute("select pname, price, qty from storeproducts")
table_rows = mycursor.fetchall()
data = tabulate(table_rows, headers=["pname", "price", "qty",
"total_price"], tablefmt="double_outline")

print(data)
print("**BILL SUCCESSFULLY GENERATED**")

if (ch == 7):
print("********Please enter your user details*******")

uid = input("Enter the user id:")

13
pwd = input("Enter the password:")

query = "select * from user where user_id='" + uid + "' and


password='" + pwd + "'"
mycursor.execute(query)
data = mycursor.fetchall()

if data != []:
print("User logged in successfully")
query = "select pname from " + uid

mycursor.execute(query)
data = mycursor.fetchall()

market = []
for i in data:
for j in i:
market.append( j)

print("*****Please enter product name to be deleted*****")


print(market)

product = input("Enter the product name from the above list:")


item = product

if item in market:
query = "delete from " + uid + " where pname='" + product + "'"
mycursor.execute(query)
mydb.commit()

print("Successfully product deleted")

14
else:
print("No Products found")

else:
print("User ID INCORRECT")

else:
print("**THANK YOU FOR SHOPPING***")
print("**BILL SUCCESSFULLY GENERATED***")

15
TABLES-
Database used-

Table used-

16
Table-a1

Table-a2

17
Table-a3

Table-a4

18
Table-a5

Table-a6

19
Table storeproducts-

Table user-

20
21
22
23
24
BIBLIOGRAPHY-

1) COMPUTER SCIENCE WITH PYTHON SUMIT ARORA

2) https://www.w3schools.com

3) https://www.mysql.com

4) https://pypi.org

APPLICATION-

A supermarket billing system is a


comprehensive business solution utilized by a
variety of retailers and other businesses. Any
shop or firm may use this software to automate
repetitive processes such as sales billing,
inventory management, purchase follow-up,
and accounts administration.

25
26

You might also like