Navneet
Navneet
EDUCATION ACADEMY
Affiliated to C.B.S.E. Board, New Delhi (10+2) Aff.No 2131159
15-C, Nathmalpur, Green City Road, Gorakhnath, Gorakhpur 273015
J.P.EDUCATION ACADEMY
Affiliated to C.B.S.E. Board, New Delhi (10+2) Aff.No 2131159
15-C, Nathmalpur, Green City Road, Gorakhnath, Gorakhpur 273015
Index
Sr. Date Title Pg. No
1 05/08/2022 Certificate
2 05/08/2022 Acknowledgment
3 05/08/2022 Preface
4 05/08/2022 Objective
5 05/08/2022 Source Code
6 05/08/2022 Output
7 05/08/2022 Bibliography
8 05/08/2022 Teacher’s Remark
J.P.EDUCATION ACADEMY
Affiliated to C.B.S.E. Board, New Delhi (10+2) Aff.No 2131159
15-C, Nathmalpur, Green City Road, Gorakhnath, Gorakhpur 273015
Certificate
Student’s Name : Navneet Srivastava
Std : 12
Division : A
Roll No : 24
Regards:
Navneet Srivastava
Class- 12
*****************************
Source
Code
*****************************
Regards:
Navneet Srivastava
Class- 12
shopping1 = shopping
temp = []
order = ""
def adminLoginWindow():
print("=====================")
print("1.Display Menu")
print("2.Add Product")
print("3.Remove Product")
print("4.Products goods available")
print("5.Total Income")
print("6.Logout")
print("=====================")
def adminDisplayMenuWindow():
print("Id\tName\tAvailable\tPrice\tOriginal Price")
print("====================================================")
for d in shopping:
print(f'{d["id"]}\t{d["Name"]}\t{d["Available"]}\t\t{d["Price"]}\
t{d["Original_Price"]}')
def addproducts():
n = int(input("Enter the no.of.items need to be added : "))
for i in range(n):
new_id = int(input("Enter id : "))
new_Name = input("Enter Name : ")
new_Available = int(input("Enter Available : "))
new_Price = int(input("Enter Price : "))
new_original = int(input("Enter the original price : "))
d = [{"id": new_id, "Name": new_Name, "Available": new_Available,
"Price": new_Price,
"Original_Price": new_original}]
shopping.extend(d)
adminDisplayMenuWindow()
def removeproducts():
dressId = int(input("Enter the id need to be deleted : "))
found = False
for d in shopping1:
found = d["id"] == dressId
if found != True:
temp.append(d)
continue
if found == True:
d["Available"] -= 1
print("Deleting item....")
if len(temp) == d:
print(f"{dressId} not found")
else:
print(f"{dressId}'s one available is removed from the list")
adminDisplayMenuWindow()
def availableproducts():
Total = 0
print("\n")
for d in shopping:
print(f'{d["Name"]} = {d["Available"]}')
Total += (d["Available"])
print("\nTotal available goods is : ", Total)
def monthlyincome():
total = 0
for d in shopping:
total += ((d["Available"] * d["Price"]) - (d["Available"] *
d["Original_Price"]))
print("\nTotal income is : ", total)
def logoutwindow():
login()
def adminOptions():
choice = int(input("Please enter user choice : "))
if choice == 1:
adminDisplayMenuWindow()
print("\n===================================================\n")
adminLoginWindow()
print("\n===================================================\n")
adminOptions()
elif choice == 2:
adminDisplayMenuWindow()
print("\n===================================================\n")
addproducts()
print("\n===================================================\n")
adminLoginWindow()
print("\n===================================================\n")
adminOptions()
elif choice == 3:
adminDisplayMenuWindow()
print("\n===================================================\n")
removeproducts()
print("\n===================================================\n")
adminLoginWindow()
print("\n===================================================\n")
adminOptions()
elif choice == 4:
availableproducts()
print("\n===================================================\n")
adminLoginWindow()
print("\n===================================================\n")
adminOptions()
elif choice == 5:
monthlyincome()
print("\n===================================================\n")
adminLoginWindow()
print("\n===================================================\n")
adminOptions()
elif choice == 6:
logoutwindow()
else:
print("\nInvalid Choice. Please enter valid choice")
print("\n===================================================\n")
adminLoginWindow()
print("\n===================================================\n")
adminOptions()
def userLoginWindow():
print("=====================\n")
print("1.Display Menu")
print("2.Place order")
print("3.Cancel order")
print("4.Logout")
print("\n======================")
def userDisplayMenuWindow():
print("Id\tName\tAvailable\tPrice")
print("===================================================")
for d in shopping:
print(f'{d["id"]}\t{d["Name"]}\t{d["Available"]}\t\t{d["Price"]}')
def user_id():
userDisplayMenuWindow()
p_id = int(input("\nEnter the id : "))
def placeOrder():
order_number = 10
userDisplayMenuWindow()
p_id = int(input("\nEnter the id : "))
for d in shopping:
if d["id"] == p_id:
print("\nId\tName\tAvailable\tPrice")
print("=============================================================")
print(f'{d["id"]}\t{d["Name"]}\t{d["Available"]}\t\
t{d["Price"]}')
order = '{d["id"]}\t{d["Name"]}\t{d["Available"]}\t\
t{d["Price"]}'
conform = input("\nDo you want to place an order on the above
shown product : Y/N ")
if d["id"] != p_id:
print("\nYou have entered invalid id. Please enter valid id\n")
user_id()
print("\nAvailable products : \n")
userDisplayMenuWindow()
def cancelOrder():
found = False
temp = []
order_id = input("Enter the order id : ")
for d in shopping:
found = d["id"] == order_id
if found != True:
temp.append(d)
if len(temp) == d:
print(f'{order_id} is not found')
else:
print(f'{order_id} is removed from the placed order')
def userChoiceOptions():
choice = int(input("Please enter user choice : "))
if choice == 1:
userDisplayMenuWindow()
print("\n===================================================\n")
userLoginWindow()
print("\n===================================================\n")
userChoiceOptions()
elif choice == 2:
placeOrder()
print("\n===================================================\n")
userLoginWindow()
print("\n===================================================\n")
userChoiceOptions()
elif choice == 3:
cancelOrder()
print("\n===================================================\n")
userLoginWindow()
print("\n===================================================\n")
userChoiceOptions()
elif choice == 4:
logoutwindow()
else:
print("Invalid Choice. Please enter valid choice")
def login():
print("\n")
print("****"*15)
print("\n")
print(" "*12 , "PACIFIC") #company name
print("\n")
print("****"*15)
print("\n")
print('''
---- Login Admin/Login User ----
[Type A to Login in the Admin/ Type U to Login in the User]
''')
i="i"
while (i!="A" and i!="U"):
i=str(input("=>"))
i=i.upper()
if (i!="A" and i!="U"):
print("[Type A to Login in the Admin/ Type U to Login in the
User]")
else:
pass
if i == 'A' or i == 'a':
password = input("Enter the password : ")
if password == "******": #change password
adminLoginWindow()
adminOptions()
else:
print("Invalid password. Please enter valid password")
if (password == password1):
print("===="*15)
print("\n")
print (" "*11 ,"CONGRATULATION LOGIN ID IS SUCCESFULL")
#message of congratulation
print("\n")
print("===="*15)
else:
print("Invalid password. Please enter valid password")
login()
J.P.EDUCATION ACADEMY
Affiliated to C.B.S.E. Board, New Delhi (10+2) Aff.No 2131159
15-C, Nathmalpur, Green City Road, Gorakhnath, Gorakhpur 273015
*****************************
Output
*****************************
Regards:
Navneet Srivastava
Class- 12
INTRODUCTION
LOGIN ADMINISTRATOR
DISPLAY MENU
ADD PRODUCT
PRODUCT IS ADDED
PRODUCTS GOOD AVAILABLE
TOTAL INCOME
LOGOUT
J.P.EDUCATION ACADEMY
Affiliated to C.B.S.E. Board, New Delhi (10+2) Aff.No 2131159
15-C, Nathmalpur, Green City Road, Gorakhnath, Gorakhpur 273015
J.P.EDUCATION ACADEMY
Affiliated to C.B.S.E. Board, New Delhi (10+2) Aff.No 2131159
15-C, Nathmalpur, Green City Road, Gorakhnath, Gorakhpur 273015
TEACHER’s REMARKS
Regards:
Navneet Srivastava
Class- 12