0% found this document useful (0 votes)
13 views4 pages

Bakery Items

class 12 IP project code

Uploaded by

bareedahzoha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views4 pages

Bakery Items

class 12 IP project code

Uploaded by

bareedahzoha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

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-8):"))
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):
c=input("Enter the name of the column:")
print(BakeryItems)
print("Column entered successfully")
elif (ch1==2):
name=input("Enter Item name:")
price=input("Enter the value:")
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("Column 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):
data=input("Enter the new data")
row=input("Enter row label")
col=input("Enter column label")
BakeryItems.at[row,col]=data
print(BakeryItems)
print('Value successfully modified')
elif(ch1==2):
name=input("Enter Item name:")
price=input("Enter the value:")
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 cateory total:")
countrec=BakeryItems.shape[0]

BakeryItems.loc[countrec]=[name,price,qty,totalsales,ctg,supp,expdate,ctgtotal]
print(BakeryItems)
print('Data modified successfully')
else:
break
elif(ch==4):
print("Delete Menu")
print("1.Delete an item name")
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)
elif(ch1==2):
stat=input("Enter the price to be deleted:")

BakeryItems.drop(BakeryItems.loc[BakeryItems['PRICE']==stat].index,inplace=True)
print(BakeryItems)
elif(ch1==3):
stat=input("Enter the quantity to be deleted:")

BakeryItems.drop(BakeryItems.loc[BakeryItems['QUANTITY']==stat].index,inplace=True)
print(BakeryItems)
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)
elif(ch1==5):
stat=input("Enter the category to be deleted:")

BakeryItems.drop(BakeryItems.loc[BakeryItems['CATEGORY']==stat].index,inplace=True)
print(BakeryItems)
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)
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)
elif(ch==8):
stat=input("Enter category total to be deleted:")
BakeryItems.drop(BakeryItems.loc[BakeryItems['CATEGORY
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-")
b_name=ch[BakeryItems]
quantity_available=ch['QUANTITY']
price_of_the_items=ch['PRICE']
plt.title("LINE GRAPH")
ch1=int(input("Enter the number:"))
if(ch1==1):

plt.plot(b_name,quantity_available,'red',marker="*",markersize=5,markeredgecolor='b
lue',label='TOTAL SALES')
plt.xlabel("Items",color='blue')
plt.ylabel("Supplier",color='blue')
plt.legend(loc='upper left')
plt.show()
elif(ch1==2):

plt.plot(b_name,price_of_the_items,'blue',marker="p",markersize=5,markeredgecolor='
k',label='total_sales')
plt.xlabel("items",color='red')
plt.ylabel("price",color='red')
plt.legend(loc='upper right')
plt.show()

elif(ch1==3):

plt.plot(b_name,quantity_available,'red',marker="*",markersize=5,markeredgecolor='b
lue',label='price')

plt.plot(b_name,price_of_the_items,'blue',marker="p",markersize=5,markeredgecolor='
k',label='BUDGET total sales')
plt.xlabel("items",color="magenta")
plt.ylabel("sales",color='magenta')
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=ch["Category"]
total_sales=ch['total sales)']
price=ch['price']
plt.title("Bar graph")
ch1=int(input("Enter the number-"))
if(ch1==1):
plt.bar(m_name,price,color="yellow")
plt.xlabel("items",color='blue')
plt.ylabel("price",color='blue')
plt.show()
elif(ch1==2):
plt.bar(m_name,total_sales,color='pink')
plt.xlabel("items",color='red')
plt.ylabel("total_sales",color='red')
elif(ch1==3):
plt.bar(m_name,total_sales,color='pink')
plt.xlabel("items",color='red')
plt.ylabel("total_sales",color='red')
else:
break
else:
break

You might also like