Professional Documents
Culture Documents
NAVODAYA VIDYALAYA
PEKHUBELA UNA
PROJECT WORK
Of
COMPUTER SCIENCE
1|Page
SHOPING AND COUNTER BILLING
SALONI
BANGWAL
PRAGATI
2|Page
CERTIFICATE
Supervisor Principal
3|Page
ACKNOWLEDGMENT
4|Page
CONTENT PAGE NUMBER
SOFTWARE LANGUAGES 05
USED
PYTHON 3.0 06
MY SQL 07
TYPES OF DBMS 08
STRUCTURED QUERY 09
LANGUAGE
SOURCE CODE 11
BIBLIOGRAPHY 22
INDEX
5|Page
SOFTWARE LANGUAGES USED
In the development of a project the selection of an appropriate
can be fulfilled depend on the s/w language chosen. More over the
developer also has to take care of the various facilities, he can use. In
Python 3.0 :
6|Page
Python is an interpreted, object-oriented, high-level programming
reuse. The Python interpreter and the extensive standard library are
bug or bad input will never cause a segmentation fault. Instead, when
program doesn't catch the exception, the interpreter prints a stack trace.
hand, often the quickest way to debug a program is to add a few print
statements to the source: the fast edit-test-debug cycle makes this simple
MY SQL
A Database Management System (DBMS) is a software application that
interacts with the user, applications and the database itself to capture
and analyze data. The data stored in the database can be modified,
retrieved and deleted, and can be of any type like strings, numbers,
images etc.
Types of DBMS
8|Page
a structure similar to that of a tree, wherein the nodes represent
piece of data, and the instructions for the actions to be done with
the data.
SQL is the core of a relational database which is used for accessing and
managing the database. By using SQL, you can add, update or delete
9|Page
1) DDL (Data Definition Language) – It allows you to perform
DELETE objects.
10 | P a g e
SQL is the most popular language for adding, accessing and managing
11 | P a g e
SOURCE CODE
import mysql.connector
conn=mysql.connector.connect(user='root',password='sa123',host='local
host',database='store')
myc=conn.cursor()
o="y"
while(o=="y" or o=="Y"):
m=""" ,,,,*shop bill management receipt*,,,,
,,,,*tax invoice*,,,,
,,,,*AR Mart*,,,,
,,,,*shop no. 4 XYZ colony*,,,,
,,,,*ABC*,,,,
,,,,*mobile number-8421468850*,,,,"""
print(m)
#press S for generating stationary bill
#press C for generating clothing bill
#press E for generating electrical appliances bill
#press G for generating grocery bill
#press X to exit from program
menu='''
#press S for generating stationary bill
#press C for generating clothing bill
#press E for generating electrical appliances bill
#press G for generating grocery bill
#press X to exit from program
'''
print(menu)
c=str(input("enter your choice(S\C\E\G\X):"))
if(c=="S" or c=="s"):
12 | P a g e
print("STATIONARY BILL")
date=input("invoice date:")
impt=int(input("no. of item purchase:"))
print("details of customer")
customer=str(input("customer's name:Mr./Miss:"))
address=str(input("customer's adress:"))
city=str(input("customer's city:"))
state=str(input("customer's state:"))
mobilenumber=int(input("customer's mobile number:"))
total=0
maxitem=41 # maximum number of items can be purchased at a
time
if(impt<=maxitem):
for a in range(1,impt+1):
print("serial no:",a)
i=str(input("item:"))
rate=float(input("price of item in rupees:"))
qty=int(input("quantity of item purchased:"))
value=qty*rate # total price of product with no. of quantity
print("Total price:",value) # total amount of particular product
total=total+value # total amount of all products
sql="insert into item (serial_no,item_name,price,quantity)
values({},'{}',{},{})".format(a,i,rate,qty)
myc.execute(sql)
conn.commit()
print("Items Purchased Till Now:")
myc.execute('select * from item')
data=myc.fetchall()
for row in data:
print(row)
print("Total Amount:",total)
gst=28/100
gtax=total*gst #gst taxed amount
price=total+gtax # total amount of all products after adding gst
13 | P a g e
if(total<100):
print("Final price:",price)
elif(total>=100 and total<=800):
discount=5/100
dprice=total*discount # discount amount
print("Final price:",price-dprice)
elif(total>800 and total<=5000):
discount=15/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>5000 and total<=14000):
discount=20/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>14000):
discount=25/100
dprice=total*discount
print("Final price:",price-dprice)
else:
print(" Sorry You Can Only Buy 41 Items At A Time")
print("STATIONARY BILL")
elif(c=="C" or c=="c"):
print("CLOTHING BILL")
date=input("invoice date:")
impt=int(input("no. of item purchase:"))
print("details of customer")
customer=str(input("customer's name:Mr./Miss:"))
adress=str(input("customer's adress:"))
city=str(input("customer's city:"))
state=str(input("customer's state:"))
mobilenumber=int(input("customer's mobile number:"))
total=0
maxitem=41 # maximum number of items can be purchased at a
time
if(impt<=maxitem):
for a in range(1,impt+1):
print("serial no:",a)
14 | P a g e
i=str(input("item:"))
rate=float(input("price of item in rupees:"))
qty=int(input("quantity of item purchased:"))
value=qty*rate # total price of product with no. of quantity
print("Total price:",value) # total amount of particular product
total=total+value # total amount of all products
sql="insert into item (serial_no,item_name,price,quantity)
values({},'{}',{},{})".format(a,i,rate,qty)
myc.execute(sql)
conn.commit()
print("Items Purchased Till Now:")
myc.execute('select * from item')
data=myc.fetchall()
for row in data:
print(row)
print("Total Amount:",total)
gst=8/100
gtax=total*gst #gst taxed amount
price=total+gtax # total amount of all products after adding gst
if(total<800):
print("Final price:",price)
elif(total>=800 and total<=6000):
discount=5/100
dprice=total*discount # discount amount
print("Final price:",price-dprice)
elif(total>6000 and total<=11000):
discount=15/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>11000 and total<=15000):
discount=20/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>15000):
discount=25/100
dprice=total*discount
print("Final price:",price-dprice)
15 | P a g e
else:
print(" Sorry You Can Only Buy 41 Items At A Time")
print("CLOTHING BILL")
elif(c=="E" or c=="e"):
print("ELECTRICAL APPLIANCES BILL")
date=input("invoice date:")
impt=int(input("no. of item purchase:"))
print("details of customer")
customer=str(input("customer's name:Mr./Miss:"))
address=str(input("customer's adress:"))
city=str(input("customer's city:"))
state=str(input("customer's state:"))
mobilenumber=int(input("customer's mobile number:"))
total=0
maxitem=41 # maximum number of items can be purchased at a
time
if(impt<=maxitem):
for a in range(1,impt+1):
print("serial no:",a)
i=str(input("item:"))
rate=float(input("price of item in rupees:"))
qty=int(input("quantity of item purchased:"))
value=qty*rate # total price of product with no. of quantity
print("Total price:",value) # total amount of particular product
total=total+value # total amount of all products
sql="insert into item (serial_no,item_name,price,quantity)
values({},'{}',{},{})".format(a,i,rate,qty)
myc.execute(sql)
conn.commit()
print("Items Purchased Till Now:")
myc.execute('select * from item')
data=myc.fetchall()
for row in data:
print(row)
print("Total Amount:",total)
gst=18/100
gtax=total*gst #gst taxed amount
16 | P a g e
price=total+gtax # total amount of all products after adding gst
if(total<1200):
print("Final price:",price)
elif(total>=1200 and total<=4000):
discount=5/100
dprice=total*discount # discount amount
print("Final price:",price-dprice)
elif(total>4000 and total<=7000):
discount=15/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>7000 and total<=12000):
discount=20/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>12000):
discount=25/100
dprice=total*discount
print("Final price:",price-dprice)
else:
print(" Sorry You Can Only Buy 41 Items At A Time")
print("ELECTRICAL APPLINCES BILL")
elif(c=="G" or c=="g"):
print("GROCERY BILL")
date=input("invoice date:")
impt=int(input("no. of item purchase:"))
print("details of customer")
customer=str(input("customer's name:Mr./Miss:"))
address=str(input("customer's adress:"))
city=str(input("customer's city:"))
state=str(input("customer's state:"))
mobilenumber=int(input("customer's mobile number:"))
total=0
maxitem=41 # maximum number of items can be purchased at a
time
if(impt<=maxitem):
for a in range(1,impt+1):
17 | P a g e
print("serial no:",a)
i=str(input("item:"))
rate=float(input("price of item in rupees:"))
qty=int(input("quantity of item purchased:"))
value=qty*rate # total price of product with no. of quantity
print("Total price:",value) # total amount of particular product
total=total+value # total amount of all products
sql="insert into item (serial_no,item_name,price,quantity)
values({},'{}',{},{})".format(a,i,rate,qty)
myc.execute(sql)
conn.commit()
print("Items Purchased Till Now:")
myc.execute('select * from item')
data=myc.fetchall()
for row in data:
print(row)
print("Total Amount:",total)
gst=4/100
gtax=total*gst #gst taxed amount
price=total+gtax # total amount of all products after adding gst
if(total<200):
print("Final price",price)
elif(total>=200 and total<=500):
discount=5/100
dprice=total*discount # discount amount
print("Final price:",price-dprice)
elif(total>500 and total<=900):
discount=15/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>900 and total<=15000):
discount=20/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>15000):
discount=25/100
dprice=total*discount
18 | P a g e
print("Final price:",price-dprice)#final price is calculated after
adding gst
else:
print(" Sorry You Can Only Buy 41 Items At A Time")
print("GROCERY BILL")
elif(c=="x" or c=="X"):
exit()
else:
print("PLEASE ENTER A VALID PRODUCT CATEGORY")
print(" S for generating stationary bill")
print(" C for generating clothing bill")
print(" E for generating electrical appliances bill")
print(" G for generating grocery bill")
t=""" ,,,,,,,THANK YOU,,,,,,,
,,,,VISIT US AGAIN,,,,
,ARMart@modernworld.in,"""
print(t)
o=input("want to run again y/n or Y/N")
#bill generation
19 | P a g e
#Table in MY SQL#
#Output Screen#
BIBLIOGRAPHY
20 | P a g e
1) Computer Science with Python (Sumita Arora)
2) SIPO Application
3) www.geeksforgeeks.org
4) www.javatpoint.com
5) www.w3resource.com
6) www.pythontutoring.com
***THANKYOU***
21 | P a g e