Bakery Items
Bakery Items
PRACTICES
PROJECT
ON
BAKERY
ITEMS
NAME:
CLASS:
ROLL.NO:
CERTIFICATE
This is to certify that
____________________of
class______,_______________________
School, has successfully completed
her Investigatory Project as
prescribed by CBSE in
the year ____________.
Date :
Roll No. :
Signature of Subject
Signature of
Teacher
External
Examiner
__________________
ACKNOWLEDGEMEN
T
It would be my utmost pleasure to
thank my
Informatics Practices teacher
____________ for giving me this
knowledgeable topic "BAKERY ITEMS"
and supporting me during the course
of this project. I would also like to
thank my parents and God for
encouraging me and giving me
strength to complete this project on
time. Secondly, I also like to thank my
partner for being co-operative and
pally with me throughout the process
and for helping me to make this a full
proof success.
PROGRAM CODE
import pandas as pd
import matplotlib.pyplot as plt
BakeryItems=pd.read_csv("C:\Documents\Project\Bakery
Items.csv")
print(BakeryItems)
while(True):
print("#### ITEMS ####")
print("1.Read")
print("2.Add data")
print("3.Modify data")
print("4.Delete data")
print("5.Linegraph")
print("6.Bargraph")
print("7.Exit")
ch=int(input("Enter your choice(1-7):"))
if(ch==1):
print(BakeryItems)
elif(ch==2):
while(True):
print("add items")
print("1.Add column")
print("2.Add row")
print("3.Exit")
ch1=int(input("Enter the number(1-3):"))
if(ch1==1):
name=input("Enter the name of the new column")
data=input("Enter the value by which you want to
initialize this column")
BakeryItems[name]=data
print(BakeryItems)
print("Column entered Successfully")
elif (ch1==2):
name=input("Enter Item name:")
price=input("Enter the price:")
qty=int(input("enter the quantity:"))
totalsales=price*qty
ctg=input("Enter the category:")
supp=input("Enter the supplier:")
expdate=input("Enter the date of expiry:")
ctgtotal=input("Enter the category total:")
countrec=BakeryItems.shape[0]
BakeryItems.loc[countrec]=[name,price,qty,totalsales,ctg,
supp,expdate,ctgtotal]
print(BakeryItems)
print("Row entered successfully")
else:
break
elif(ch==3):
while(True):
print("Modify Menu")
print("1.Modify any particular value")
print("2.Modify given bakery item details")
print("3.Exit")
ch1=int(input("Enter your choice 1-3:"))
if(ch1==1):
index=int(input("Enter the Index Value of the
Item:"))
col_name=input("Enter the Column Name of the
Item:")
MD=input("Enter New Data:")
BakeryItems.loc[index,col_name]=MD
print(BakeryItems)
print('Value modified successfully')
elif(ch1==2):
Item_Name=input("Enter the ItemName whose
details are to be modified:")
if Item_Name in BakeryItems["ITEM NAME"].values:
PRICE=input("Enter new Price:")
QUANTITY=input("Enter new Quantity:")
TOTAL_SALES=("Enter new Total_Sales:")
CATEGORY=input("Enter new Category:")
SUPPLIER=input("Enter new Supplier:")
EXPIRY_DATE=input("Enter new Expiry Date:")
CATEGORY_TOTAL=input("ENTER new Category
Total")
BakeryItems.loc[BakeryItems["ITEM
NAME"]==Item_Name,:]=[PRICE,QUANTITY,TOTAL_SALES,
CATEGORY,SUPPLIER,EXPIRY_DATE,CATEGORY_TOTAL]
print("Item Details Modified Successfully")
print(BakeryItems)
else:
break
elif(ch==4):
while(True):
print("Delete Menu")
print("1.Delete an item")
print("2.Delete a price")
print("3.Delete a quantity")
print("4.Delete the total sales")
print("5.Delete a category")
print("6.Delete a supplier")
print("7.Delete an expiry date")
print("8.Delete the category total")
print("9.Exit")
ch1=int(input("Enter your choice 1-9:"))
if(ch1==1):
data=input("Enter the item name to be deleted:")
BakeryItems.drop(BakeryItems.loc[BakeryItems['ITEM
NAME']==data].index,inplace=True)
print(BakeryItems)
print("Data Deleted successfully")
elif(ch1==2):
stat=input("Enter the price to be deleted:")
BakeryItems.drop(BakeryItems.loc[BakeryItems['PRICE']=
=stat].index,inplace=True)
print(BakeryItems)
print("Data Deleted successfully")
elif(ch1==3):
stat=input("Enter the quantity to be deleted:")
BakeryItems.drop(BakeryItems.loc[BakeryItems['QUANTITY
']==stat].index,inplace=True)
print(BakeryItems)
print("Data Deleted successfully")
elif(ch1==4):
stat=input("Enter the total sales to be deleted:")
BakeryItems.drop(BakeryItems.loc[BakeryItems['TOTAL
SALES']==stat].index,inplace=True)
print(BakeryItems)
print("Data Deleted successfully")
elif(ch1==5):
stat=input("Enter the category to be deleted:")
BakeryItems.drop(BakeryItems.loc[BakeryItems['CATEGOR
Y']==stat].index,inplace=True)
print(BakeryItems)
print("Data Deleted successfully")
elif(ch1==6):
stat=input("Enter name of the supplier to be deleted:")
BakeryItems.drop(BakeryItems.loc[BakeryItems['SUPPLIER'
]==stat].index,inplace=True)
print(BakeryItems)
print("Data Deleted successfully")
elif(ch1==7):
stat=input("Enter the expiry date to be deleted:")
BakeryItems.drop(BakeryItems.loc[BakeryItems['EXPIRY
DATE']==stat].index,inplace=True)
print(BakeryItems)
print("Data Deleted successfully")
elif(ch==8):
stat=input("Enter category total to be deleted:")
BakeryItems.drop(BakeryItems.loc[BakeryItems['CATEGOR
Y TOTAL']==stat].index,inplace=True)
print(BakeryItems)
print("Data Deleted successfully")
else:
break
elif(ch==5):
print("Line graph")
print("1.to get total sales")
print("2.To get category total")
print("3.All data-")
print("4.Exit-")
x=BakeryItems['TOTAL SALES']
y=BakeryItems['QUANTITY']
z=BakeryItems['PRICE']
plt.title("LINE GRAPH")
ch1=int(input("Enter the number:"))
if(ch1==1):
plt.plot(x,y,'red',marker="*",markersize=5,markeredgecol
or='blue',label='TOTAL SALES')
plt.xlabel("Items",)
plt.ylabel("Supplier")
plt.legend(loc='upper left')
plt.show()
elif(ch1==2):
plt.plot(x,z,'blue',marker="p",markersize=5,markeredgeco
lor='k',label='Total_Sales')
plt.xlabel("items")
plt.ylabel("price")
plt.legend(loc='upper right')
plt.show()
elif(ch1==3):
plt.plot(x,y,'red',marker="*",markersize=5,markeredgecol
or='blue',label='price')
plt.plot(x,z,'blue',marker="p",markersize=5,markeredgeco
lor='k',label='BUDGET Total Sales')
plt.xlabel("items")
plt.ylabel("sales")
plt.legend(loc='upper left')
plt.show()
else:
break
elif(ch==6):
print("Bar graph")
print("1.To get Total sales")
print("2.To get Category total")
print("3.All Data")
print("4.Exit")
m_name=BakeryItems['CATEGORY']
Total_Sales=BakeryItems['TOTAL SALES']
Price=BakeryItems['PRICE']
plt.title("Bar graph")
ch1=int(input("Enter the number:"))
if(ch1==1):
plt.bar(m_name,Price,color="brown")
plt.xlabel("Items",color='blue')
plt.ylabel("Price",color='blue')
plt.show()
elif(ch1==2):
plt.bar(m_name,Total_Sales,color='black')
plt.xlabel("Items",color='green')
plt.ylabel("Total Sales",color='green')
elif(ch1==3):
plt.bar(Price,Total_Sales,color='yellow')
plt.xlabel("Items",color='red')
plt.ylabel("Total Sales",color='red')
else:
break
else:
break
CSV FILE
OUTPUT
READ DATA
ADD DATA
MODIFY DATA
DELETE DATA
PLOT CHART 1
PLOT CHART 2
PLOT CHART 3
BAR CHART 1
BAR CHART 2
BAR CHART 3