You are on page 1of 21

PM SHRI SCHOOL JAWAHAR

NAVODAYA VIDYALAYA
PEKHUBELA UNA

PROJECT WORK
Of
COMPUTER SCIENCE

1|Page
SHOPING AND COUNTER BILLING

SUBMITTED BY: SUBMITTED TO:

NAME ROLL MR. AMIT KUMAR


NUMBER
RADHA
(P.G.T COMPUTER
SHREE
KARANIYA SCIENCE)
VANSHIKA
CHOUDHARY
KASHISH
SHARMA

SALONI
BANGWAL
PRAGATI

2|Page
CERTIFICATE

This is to certify that the project entitled “SHOPPING AND

COUNTER BILLING”, Which contain menu driven program for

General Operation at shops/malls. This project is being submitted by

Group 3. This project is a bonafide piece of work carried out by us with

the consultation of supervisor.

Supervisor Principal

Mr. Amit Kumar Mr. Raj Singh

3|Page
ACKNOWLEDGMENT

It is with great pleasure that we find ourselves penning


down these lines to express our sincere thanks to various
people who helped us a long way in completing this project.

The harmonious climate in our school provided proper


guide for preparing the same project to him. It was a privilege
to have been guided by Mr. Amit Kumar.

Thanks to all our classmates who helped us during the


development of this project with their constructive criticism
and advice.

4|Page
CONTENT PAGE NUMBER

SOFTWARE LANGUAGES 05
USED

PYTHON 3.0 06

MY SQL 07

TYPES OF DBMS 08

STRUCTURED QUERY 09
LANGUAGE

MY SQL AND SQL 10

SOURCE CODE 11

BIBLIOGRAPHY 22

INDEX

5|Page
SOFTWARE LANGUAGES USED
In the development of a project the selection of an appropriate

programming language and a platform is of primary importance. The

major part of credit of success of a project goes to the software

environment chosen by the developer. Selecting a language from the

ocean of the languages is very difficult. A developer has to consider the

various features and functionalities that a particular language can

provide him/her how easily and successfully the requirements of a user

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

the development of this application, it has been taken into great

consideration that server overhead should be low as far as possible.

Python 3.0 :

6|Page
Python is an interpreted, object-oriented, high-level programming

language with dynamic semantics. Its high-level built in data structures,

combined with dynamic typing and dynamic binding, make it very

attractive for Rapid Application Development, as well as for use as a

scripting or glue language to connect existing components together.

Python's simple, easy to learn syntax emphasizes readability and

therefore reduces the cost of program maintenance. Python supports

modules and packages, which encourages program modularity and code

reuse. The Python interpreter and the extensive standard library are

available in source or binary form without charge for all major

platforms, and can be freely distributed.

Often, programmers fall in love with Python because of the increased

productivity it provides. Since there is no compilation step, the edit-test-

debug cycle is incredibly fast. Debugging Python programs is easy: a

bug or bad input will never cause a segmentation fault. Instead, when

the interpreter discovers an error, it raises an exception. When the

program doesn't catch the exception, the interpreter prints a stack trace.

A source level debugger allows inspection of local and global variables,

evaluation of arbitrary expressions, setting breakpoints, stepping


7|Page
through the code a line at a time, and so on. The debugger is written in

Python itself, testifying to Python's introspective power. On the other

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

approach very effective.

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

There are mainly 4 types of DBMS, which are Hierarchical, Relational,

Network, and Object-Oriented DBMS.

1) Hierarchical DBMS: As the name suggests, this type of DBMS

has a style of predecessor-successor type of relationship. So, it has

8|Page
a structure similar to that of a tree, wherein the nodes represent

records and the branches of the tree represent fields.

2) Relational DBMS (RDBMS): This type of DBMS, uses a

structure that allows the users to identify and access data in

relation to another piece of data in the database.

3) Network DBMS: This type of DBMS supports many to many

relations wherein multiple member records can be linked.

4) Object-oriented DBMS: This type of DBMS uses

small individual software called objects. Each object contains a

piece of data, and the instructions for the actions to be done with

the data.

Structured Query Language (SQL):

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

rows of data, retrieve subsets of information, modify databases and

perform many actions. The different subsets of SQL are as follows:

9|Page
1) DDL (Data Definition Language) – It allows you to perform

various operations on the database such as CREATE, ALTER and

DELETE objects.

2) DML (Data Manipulation Language) – It allows you to access

and manipulate data. It helps you to insert, update, delete and

retrieve data from the database.

3) DCL (Data Control Language) – It allows you to control access

to the database. Example – Grant or Revoke access permissions.

4) TCL (Transaction Control Language) – It allows you to deal

with the transaction of the database. Example – Commit, Rollback,

Savepoint, Set Transaction.

MYSQL AND SQL

MySQL is an open-source relational database management system that

works on many platforms. It provides multi-user access to support many

storage engines and is backed by Oracle. MySQL is a freely available

open source Relational Database Management System (RDBMS) that

uses Structured Query Language (SQL).

10 | P a g e
SQL is the most popular language for adding, accessing and managing

content in a database. It is most noted for its quick processing, proven

reliability, ease and flexibility of use. MySQL is an essential part of

almost every open source PHP application.

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()

#details given by manager

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

You might also like