You are on page 1of 22

COMPUTER SCIENCE

PROJECT REPORT

Teacher in-charge : Mrs. Revathy Venugopal

Title of the Project:

Submitted by:

1|Page
Ryan International School Sharjah
(Affiliated to the Central Board of Secondary Education, New Delhi)

Certificate
Roll no: _________________________

This is to certify that the work in this project is the Bonafide work of
Miss/Master ___________________________________ of Grade __________ Section _______ prescribed by
The Central Board of Secondary Education, New Delhi during the
academic year 2023-2024.

Revathy Venugopal
Teacher-in-charge

____________________________________ ________________________________________________

Date External Examiner

ACKNOWLEDGEMENT
2|Page
I take this opportunity to express my sincere
gratitude and deep regard to my Computer Science
teacher Mrs. Revathy Venugopal for her valuable
guidance and advice.

I would also like to thank my parents for their


moral support and encouragement.
This project is the successful result of the
cooperation and hard work of all the team
members.

Above all I thank God Almighty for his blessing


without which this project would have been
impossible.

3|Page
Abstract

4|Page
Index
CONTENT Page No.
S. No
1. Network 6
Specification of the
Computer
2. CSV Files Used 7
3. Login and Menu 9
Page
4. Add new product 11
5. Show all products 13
in stock
6. Compare products 14
7. Show charts 15

8. Delete products 19
9. Update product 21

5|Page
1. NETWORK SPECIFICATIONS OF THE
COMPUTER

1. A Computer/Laptop with
2. Operating System-Windows 8 or above
3. x86 64-bit CPU (Intel / AMD architecture)
4. 4 GB RAM.
5. 5 GB free disk space.

Open-Source Software used:


1. Spyder IDE
2. Pandas Library preinstalled
3. Matplotlib Library preinstalled
4. MS-Office installed

6|Page
2. CSV FILES USED

a) Electronics List.csv

7|Page
B) Purchased List.csv

8|Page
3. LOGIN AND MENU PAGE

def login():

pwd = str(input('ENTER THE PASSWORD:'))

if pwd == 'employee@abc':

print ('password correct')

return True

else :

print('password wrong')

return False

def showmenu():

print('------------------------------------------------------------------------------------')

print(' ELECTRONIC STORE STOCK MANAGEMENT ')

print('------------------------------------------------------------------------------------')

print('Press 1 - Add a new Product')

print('Press 2 - Show all products in stock')

print('Press 3 - Compare two products')

print('Press 4 - Show charts')

print('Press 5 - To delete a product')

print('Press 6 - To update the product details')

9|Page
ch = int(input('Enter the number:'))

return ch

if login():

while True:

ch = showmenu()

if ch == 1:

addnewproduct()

elif ch == 2:

showproduct()

elif ch == 3 :

compareproducts()

elif ch == 4:

showcharts()

elif ch == 5:

deleteproduct()

elif ch == 6:

updateproduct()

else:

print('INVALID NUMBER SELECTED')

print ('THANKYOU FOR USING STOCK MANAGEMENT SYSTEM')

10 | P a g e
4. Add new product

def addnewproduct():

Item_No = int(input('Enter Item number:'))

Product = input('Enter Product name:')

Supplier = input('Enter Supplier name:')

Product_Description = input('Enter Product description:')

Category = input('Enter the category:')

Quantity_in_stock = int(input('Enter the quantity in stock:'))

Price_unit = int(input('Enter the price per unit:'))

Total_Value = int(input('Enter the total price:'))

Stock_Location = input('Enter the store location:')

Product_code = input('Enter the product code:')

pdf = pd.read_csv(r"C:\Users\97150\Desktop\info project\Electronics list.csv")

n = pdf['Item_No'].count()

11 | P a g e
pdf.at[n] = [Item_No,Product,Supplier,Product_Description,

Category,Quantity_in_stock,Price_unit,Total_Value,

Stock_Location,Product_code]

pdf.to_csv(r"C:\Users\97150\Desktop\info project\Electronics list.csv",index = False)

print('product added successfully!')

pd.set_option('display.max_columns', pdf.columns.size)

pd.set_option('display.expand_frame_repr',False)

print(pdf)

12 | P a g e
5. SHOW ALL PRODUCTS IN STOCK

def showproduct():

pdf=pd.read_csv(r"C:\Users\97150\Desktop\info project\Electronics list.csv")

pd.set_option('display.max_columns', pdf.columns.size)

pd.set_option('display.expand_frame_repr',False)

print(pdf)

13 | P a g e
6. COMPARE PRODUCTS

def compareproducts():

pname1 = input('Enter the name of product-1:')

pname2 = input('Enter the name of product-2:')

pdf = pd.read_csv(r"C:\Users\97150\Desktop\info project\Electronics list.csv")

df = pdf.loc[pdf['Product']==pname1]

pdf = pd.read_csv(r"C:\Users\97150\Desktop\info project\Electronics list.csv")

df1 = pdf.loc[pdf['Product']==pname2]

if df.empty:

print('Product-1 not found in stocks')

else :

print('Product-1 details are:')

pd.set_option('display.max_columns', pdf.columns.size)

pd.set_option('display.expand_frame_repr',False)

print(df)

if df1.empty:

print('Product-2 not found in stocks')

else :

print('Product-2 details are:')

pd.set_option('display.max_columns', pdf.columns.size)

pd.set_option('display.expand_frame_repr',False)

print(df1)

14 | P a g e
7. SHOW CHARTS

15 | P a g e
import matplotlib.pyplot as plt

def showcharts():

print('Press 1 - To display graph of products in stock')

print('Press 2 - To display graph of purchased product')

ch = int(input('Enter the number:'))

if ch == 1:

16 | P a g e
print('Press 1 - For bar graph')

print('Press 2 - For line graph')

a = int(input('enter the number:'))

if a == 1:

df = pd.read_csv(r"C:\Users\97150\Desktop\info project\Electronics list.csv")

df = df[['Product','Quantity_in_stock']]

df.plot('Product','Quantity_in_stock',kind = 'bar')

plt.xlabel('Product')

plt.ylabel('Quantity')

plt.show()

if a == 2:

df = pd.read_csv(r"C:\Users\97150\Desktop\info project\Electronics list.csv")

df = df[['Product','Quantity_in_stock']]

df.plot('Product','Quantity_in_stock',kind = 'line')

plt.xlabel('Product')

plt.ylabel('Quantity')

plt.show()

if ch == 2:

print('Press 1 - For bar graph')

print('Press 2 - For line graph')

a = int(input('enter the number:'))

if a == 1:

df = pd.read_csv(r"C:\Users\97150\Desktop\info project\purchsed list.csv")

df = df[['Product','Quantity_Purchased']]

df.plot('Product','Quantity_Purchased',kind = 'bar', color = 'red')

plt.xlabel('Product')

plt.ylabel('Purchsed')

plt.show()

if a == 2:

df = pd.read_csv(r"C:\Users\97150\Desktop\info project\purchsed list.csv")

df = df[['Product','Quantity_Purchased']]

17 | P a g e
df.plot('Product','Quantity_Purchased',kind = 'line', color = 'red')

plt.xlabel('Product')

plt.ylabel('Purchsed')

plt.show()

18 | P a g e
8. DELETE PRODUCTS

def deleteproduct():

print('Press 1 - To delete product from existing stock')

print('Press 2 - To delete product from purchased stock')

ch = int(input('Enter the number:'))

if ch == 1:

Product_code = int(input('enter the product ID:'))

df1 = pd.read_csv(r"C:\\Users\97150\Desktop\info project\Electronics list.csv")

df1 = df1.drop(df1[df1['Product_code'] == Product_code].index)

df1.to_csv(r"C:\\Users\97150\Desktop\info project\Electronics list.csv", index = False)

19 | P a g e
if df1.empty:

print('The entered product code is invalid')

else:

print('Product deleted successfully!')

pd.set_option('display.max_columns', df1.columns.size)

pd.set_option('display.expand_frame_repr',False)

print(df1)

if ch == 2:

Product_code = int(input('enter the product ID:'))

df1 = pd.read_csv(r"C:\Users\97150\Desktop\info project\purchsed list.csv")

df1 = df1.drop(df1[df1['Product_code'] == Product_code].index)

df1.to_csv(r"C:\Users\97150\Desktop\info project\purchsed list.csv" , index = False)

if df1.empty:

print('The entered product code is invalid')

else:

print('Product deleted successfully!')

pd.set_option('display.max_columns', df1.columns.size)

pd.set_option('display.expand_frame_repr',False)

print(df1)

20 | P a g e
9. UPDATE PRODUCT

def updateproduct():

print('Press 1 - To update the stock location')

21 | P a g e
print('Press 2 - To update the Product name')

ch = int(input('Enter the number:'))

if ch == 1:

df = pd.read_csv(r"C:\\Users\97150\Desktop\info project\Electronics list.csv")

a=int(input('Enter Item No.:'))

if a>26:

print('no product found')

else:

b=int(a-1)

c=input('Enter new Location')

df.loc[b, 'Stock_Location'] = c

df.to_csv(r"C:\\Users\97150\Desktop\info project\Electronics list.csv", index=False)

pd.set_option('display.max_columns', df.columns.size)

pd.set_option('display.expand_frame_repr',False)

print(df)

if ch == 2:

df = pd.read_csv(r"C:\\Users\97150\Desktop\info project\Electronics list.csv")

a=int(input('Enter Item No.:'))

b=int(a-1)

c=input('Enter new name')

df.loc[b, 'Product'] = c

df.to_csv(r"C:\\Users\97150\Desktop\info project\Electronics list.csv", index=False)

pd.set_option('display.max_columns', df.columns.size)

pd.set_option('display.expand_frame_repr',False)

print(df)

22 | P a g e

You might also like