CS Project - Model Format
CS Project - Model Format
ON
(2020 - 2021)
Grade : XII
February 2021
1
SCHOOL COPY
CERTIFICATE
DATE : PRINCIPAL
2
SCHOOL COPY
ACKNOWLEDGEMENT
3
SCHOOL COPY
DECLARATION
and my indebtedness to other work publications, references, if any, have been duly
acknowledged.
4
SCHOOL COPY
CONTENTS
PAGE
S.NO TITLE
NO.
06. MOTIVE
08. BIBLIOGRAPHY
09. LIMITATIONS
5
SCHOOL COPY
INTRODUCTION TO PYTHON
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.
History of Python:
6
SCHOOL COPY
INTRODUCTION TO THE PROJECT
The Medicine Stock Checking System software is an ERP software used by medicine
shops or medicine dealers for wholesale/retail business. This software stores details of
medicines and helps us to search medicines by their name and manufacturer. It is
possible to edit medicine cost and sell the medicine. The balance i.e. due amount of
the stock can also be checked. If the medicine is expired ,the system has the provision
to dispose it to the system specified warehouse. The program is also useful to check
the details of the expired medicines.
7
SCHOOL COPY
SYSTEM REQUIREMENTS
HARDWARE REQUIREMENT:
SOFTWARE REQUIREMENT:
➢ Windows 7 or higher
➢ My-SQL server 5.5 or higher(as backend)
➢ Python idle 3.6 or higher or spyder ( as frontend )
➢ Microsoft Word 2010 or higher for documentation.
8
SCHOOL COPY
BACKEND DETAILS
Code:
Use Medicine;
Attributes:
name varchar(50)
manuf varchar(50)
date_man date
date_exp date
quantity int
sell int
balance int
cost_unit int
Code:
9
SCHOOL COPY
Table Name: DISPOSE
Attributes:
Batch_no int(11)
Name varchar(50)
date_exp date
amount int
Code:
10
SCHOOL COPY
FRONT-END DETAILS
PROGRAM CODE
import sys
import random
import datetime
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',password='abhisek',database
='medicine')
mycur=mycon.cursor()
def Store():
sql="Insert into
stock(batch_no,name,manuf,date_man,date_exp,quantity,sell,balance,cost_unit)value
s(%s,%s,%s,%s,%s,%s,%s,%s,%s)"
sell=0
balance=quan
value=(acc,nm,addr,dbs,dacc,quan,sell,balance,cost)
try:
mycur.execute(sql,value)
11
SCHOOL COPY
print(nm,'ADDED TO THE STOCK')
mycon.commit()
except:
def Search_by_Name():
value=(ph,)
mycur.execute(sql,value)
rec=mycur.fetchone()
if(rec==None):
else:
print('BATCH NUMBER:\t',rec[0])
print('MEDICINE NAME:\t',rec[1])
print('MANUFACTURER:\t',rec[2])
print('DATE OF MANUFACTURE:\t',rec[3])
print('DATE OF EXPIRY:\t',rec[4])
print('QUANITTY STORED:\t',rec[5])
print('INITIAL COST:\t',rec[8])
def Search_by_Manu():
value=(ph,)
mycur.execute(sql,value)
12
SCHOOL COPY
rec=mycur.fetchall()
if(rec==None):
else:
for nm in rec:
print(nm[0])
def Cost_Update():
value=(addr,ph)
try:
mycur.execute(sql,value)
mycon.commit()
except:
def Sell():
value2=(ph,)
13
SCHOOL COPY
mycur.execute(sql2,value2)
rec=mycur.fetchone()
if(addr>rec[0]):
return
else:
balance=rec[0]-addr
value=(addr,balance,ph)
try:
mycur.execute(sql,value)
mycon.commit()
print(addr,'UNITS OF',ph,'SOLD')
print(balance,'UNITS LEFT')
except:
def Available():
value=(ph,)
mycur.execute(sql,value)
rec=mycur.fetchone()
if(rec==None):
else:
14
SCHOOL COPY
def Dispose():
t_date=datetime.date.today()
value2=(nm,t_date)
mycur.execute(sql2,value2)
rec=mycur.fetchone()
if(rec==None):
else:
print(nm,'IS EXPIRED')
if(c==1):
b=rec[0]
n=rec[1]
d=rec[2]
am=rec[3]
value=(b,n,d,am)
value3=(n,)
15
SCHOOL COPY
try:
mycur.execute(sql,value)
mycon.commit()
print(n,'SUCCESSFULLY DISPOSED')
mycur.execute(sql3,value3)
mycon.commit()
except:
else:
return
def Search_Dispose():
value=(ph,)
mycur.execute(sql,value)
rec=mycur.fetchone()
if(rec==None):
else:
print('BATCH NUMBER:\t',rec[0])
print('MEDICINE NAME:\t',rec[1])
print('DATE OF EXPIRY:\t',rec[2])
print('BALANCE AMOUNT:\t',rec[3])
16
SCHOOL COPY
def Graph():
value=(ad,)
mycur.execute(sql,value)
T=mycur.fetchone()
N=[T[5],T[6],T[7]]
L=['QUANTITY','SELL','BALANCE']
clr=('red','blue','green')
plt.bar(L,N,color=clr)
plt.xlabel('MEDICINE STATUS')
plt.ylabel('VALUES')
plt.title('MEDICINE QUANITTY-SELL-BALANCE')
plt.show()
def Close():
sys.quit()
while(True):
17
SCHOOL COPY
print('PRESS 6 TO CHECK AVAILABILITY')
if(choice==1):
Store()
elif(choice==2):
Search_by_Name()
elif(choice==3):
Search_by_Manu()
elif(choice==4):
Cost_Update()
elif(choice==5):
Sell()
elif(choice==6):
Available()
elif(choice==7):
Dispose()
elif(choice==8):
Search_Dispose()
elif(choice==9):
Graph()
else:
Close()
18
SCHOOL COPY
19
SCHOOL COPY
MOTIVE
❖ To maintain the medicine stock details, sell medicine, update stock details,
providing medicine amount enquiry by simple search technique.
❖ To dispose medicines which are expired and provide the facility to search the
disposed medicines.
❖ Globalized usage.
20
SCHOOL COPY
SCREEN SHOTS OF EXECUTION
MAIN MENU
21
SCHOOL COPY
22
SCHOOL COPY
SELLING MEDICINE
CHECKING AVAILABILITY
DISPOSING MEDICINES
23
SCHOOL COPY
24
SCHOOL COPY
SEARCHING EXPIRED MEDICINE BY NAME
25
SCHOOL COPY
LIMITATIONS
❖ The project does not have the facility to take care of the medicines
which are to be refunded i.e. there is no mechanism to keep the
account of the refunded medicines.
26
SCHOOL COPY
BIBLIOGRAPHY
BOOKS:
WEBSITES:
✓ www.geeksforgeeks.org
✓ https://docs.python.org/3/
✓ https://www.w3schools.com/python/
*********
27