0% found this document useful (0 votes)
16 views33 pages

Class Xii CS Manvi

Uploaded by

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

Class Xii CS Manvi

Uploaded by

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

COMPUTER SCIENCE (083)

PROJECT
ON

Electronics Store

MADE BY:
ROLL NO. ___________
NAME : MANVI SINGH
CLASS – SECTION – XII A

SUBMITTED TO:
CERTIFICATE
This is to certify that MANVI SINGH has made this project on
ELECTRONICS STORE MANAGEMENT under the guidance of
______

This is an original copy of the project. It has not been


submitted anywhere else for any other purpose.
I certify that this project is made as per the instructions issued
by CBSE.
TABLE OF CONTENTS

1. Acknowledgement

2. Overview of Python

3. Source code

4. Output

5. Bibliography
ACKNOWLEDGEMENT

I would like to express my sincere gratitude to my


computer science teacher _______ for her constant
guidance, support and for lending a helping hand,
without which this project would not have come
forth.

Moreover, I would like to thank my parents for their


encouragement in completing this project and my
teammates for playing a crucial role at every step of
the project.

MANVI SINGH
Overview of Python

Python is a widely used general-purpose, high-level


programming language.
Its design philosophy emphasizes code readability,
and its syntax allows programmers to express
concepts in fewer lines of code than would be
possible in languages such as C++ or Java.
The language provides constructs intended to
enable clear programs on both a small and large
scale.

Python supports multiple programming paradigms,


including object-oriented, imperative and functional
programming or procedural styles.
It features a dynamic type system and
automatic memory management and has a large
and comprehensive standard library.
SOURCE CODE

import mysql.connector as sql


import time as t
mydb=sql.connect(host='localhost', user='root', passwd='niu123',
database='cs_project')
cursor=mydb.cursor()

print("***************************************************
***********")
print("|||||*****WELCOME TO XYZ ELECTRONICS*****|||||")
print("***************************************************
***********\n")

CD=[]
print("Let the registration begin!!")
Name=input("Enter your full name: ")
CD.append(Name)

PhNo=int(input("Enter your 10-digit mobile number: "))


CD.append(PhNo)

Add=input("Enter your full address: ")


CD.append(Add)
Email=input("Enter your email id: ")
CD.append(Email)

print("Registration done successfully!")


print("----------------------------------------------------------")

itemnlist=[]
pricelist=[]
returnlist=[]
crntpricelist=[]
opt=0
while opt!=5:
print("")
print("**********HOMEPAGE***********")
print("")
print("We have the folllowing options:\n")
print("Press 1 - Purchase\nPress 2 - Return\nPress 3 -
Repairs\nPress 4 - Go To Cart\n")

opt=int(input("Enter Your Option: "))

if opt==1: #PURCHASE OPTION


print("You have selected Purchase\n")
pur=0
def purhelp(prange, cat, prnge):
print("Your price range is ", prange,"\n")
print("You have the following options:\n")
x=[cat, prnge]
cursor.execute("select UID, Product_name, Price from
electronics_store WHERE Category=%s AND Price_range=%s", x)
S=cursor.fetchall()
if len(S)==0:
print("Sorry! There are no products available right no.!")
else:
for row in S:
print("UID Code:- ", row[0])
print("Product Name:- ", row[1])
print("Price of Product:- ", row[2])
print("-----------------------------")
itemn=input("Enter UID Code of product you want to buy: ")
for row in S:
if row[0]==itemn:
print("You have selected ", row[1],"of price",row[2],"\n")
itemnlist.append(row[1]) #to append product name
pricelist.append(row[2]) #to append price of product

while pur!=5:
print("We have the following options:\n")
print("Press 1 - Mobiles & Accessories\nPress 2 - Laptops &
Accessories\nPress 3 - Home Theatre\nPress 4 - Speakers &
Audio\nPress 5 - Homepage\n")
pur=int(input("Enter Your Option: "))
print()
if pur==1: #for mobiles & accessories
print("You have selected Mobiles & Accessories\n")
print("Please Select Your Price Range:\n")
print("Press 1 - under 20,000\nPress 2 - 20,000 to
35,000\nPress 3 - 35,000 to 50,000\nPress 4 - 50,000 and above\n")
p=int(input("Enter Your Option: ")) #price option
if p==1:
price="under 20,000"
purhelp(price, 1, 1)

if p==2:
price="20,000 to 35,000"
purhelp(price, 1, 2)

if p==3:
price="35,000 to 50,000"
purhelp(price, 1, 3)

if p==4:
price="50,000 and above"
purhelp(price, 1, 4)
if pur==2: # for laptops & accessories
print("You have selected Laptops & Accessories\n")
print("Please Select Your Price Range:\n")
print("Press 1 - under 20,000\nPress 2 - 20,000 to
35,000\nPress 3 - 35,000 to 50,000\nPress 4 - 50,000 and above\n")
p=int(input("Enter Your Option: ")) #price option
if p==1:
price="under 20,000"
purhelp(price, 2, 1)

if p==2:
price="20,000 to 35,000"
purhelp(price, 2, 2)

if p==3:
price="35,000 to 50,000"
purhelp(price, 2, 3)

if p==4:
price="50,000 and above"
purhelp(price, 2, 4)
if pur==3: #for Home Theatre
print("You have selected Home Theatre\n")
print("Please Select Your Price Range:\n")
print("Press 1 - under 20,000\nPress 2 - 20,000 to
35,000\nPress 3 - 35,000 to 50,000\nPress 4 - 50,000 and above\n")
p=int(input("Enter Your Option: ")) #price option
if p==1:
price="under 20,000"
purhelp(price, 3, 1)

if p==2:
price="20,000to 35,000"
purhelp(price, 3, 2)

if p==3:
price="35,000 and 50,000"
purhelp(price, 3, 3)

if p==4:
price="50,000 and above"
purhelp(price, 3, 4)

if pur==4: # for Speakers & Audio


print("You have selected Speakers & Audio\n")
print("Please Select Your Price Range:\n")
print("Press 1 - under 20,000\nPress 2 - 20,000 to
35,000\nPress 3 - 35,000 to 50,000\nPress 4 - 50,000 and above\n")
p=int(input("Enter Your Option: ")) # price option
if p==1:
price="under 20,000"
purhelp(price, 4, 1)

if p==2:
price="20,000 to 35,000"
purhelp(price, 4, 2)

if p==3:
price="35,000 to 50,000"
purhelp(price, 4, 3)

if p==4:
price="50,000 and above"
purhelp(price, 4, 4)

if pur==5:
break
#check itemlist
#check pricelist
continue

if opt==2: #RETURN OPTION


print("You have selected Return\n")
product="0"
while product!="5":
product=input("Select the product to be returned:\nPress 1 -
Mobile\nPress 2 - Laptop\nPress 3 - TV\nPress 4 - Speakers\nPress 5
- Exit Return")
print("")
if product=="1":
cursor.execute("select UID, Product_name, Price/2 as
'Current Price' from electronics_store where Category=1;")
S=cursor.fetchall()
if len(S)==0:
print("Sorry! There are no products available right now!")
else:
for row in S:
print("UID Code:- ", row[0])
print("Product Name:- ", row[1])
print("Current Price:- ", row[2])
print("---------------------------")

returnuid=input("Enter the UID Codee of product you want


to return: ")
for row in S:
if row[0]==returnuid:
print("You have selected ", row[1], "to return, whose
current price is",row[2],"\n")
returnlist.append(row[1]) #append name
crntpricelist.append(row[2]) #append current price
break
print("---------------------------")
print("Return Policy Charges is Rs 1000")
print("---------------------------\n")

print("We have the following time slots: ")


print("Press 1 - Tuesday, 5PM to 7PM\nPress 2 - Thursday,
2PM to 4PM\nPress 3 - Sunday, 1PM to 3PM\n")
time=int(input("Please select the suitable slot: "))
if time==1:
print("The product will be picked from your residence on
Tuesday, between 5PM and 7PM\n")
if time==2:
print("The product will be picked from your residence on
Thursday, between 2PM to 4PM\n")
if time==3:
print("The product will be picked from your residence on
Sunday, between 1PM to 3PM\n")
print("Current Price of the product and our Return Policy
charges will be debited to your account on checkout.\n")
if product=="2":
cursor.execute("select UID, Product_name, Price/2 as
'Current Price' from electronics_store where Category=2;")
S=cursor.fetchall()
if len(S)==0:
print("Sorry! There are no products available right now!")
else:
for row in S:
print("UID Code:- ", row[0])
print("Product Name:- ", row[1])
print("Current Price:- ", row[2])
print("---------------------------")

returnuid=input("Enter the UID Code of product you want to


return: ")
for row in S:
if row[0]==returnuid:
print("You have selected ", row[1], "to return, whose
current price is",row[2],"\n")
returnlist.append(row[1]) #append name
crntpricelist.append(row[2]) #append current price
break
print("---------------------------")
print("Return Policy Charges is Rs 1000")
print("---------------------------\n")

print("We have the following time slots: ")


print("Press 1 - Tuesday, 5PM to 7PM\nPress 2 - Thursday,
2PM to 4PM\nPress 3 - Sunday, 1PM to 3PM\n")
time=int(input("Please select the suitable slot: "))
if time==1:
print("The product will be picked from your residence on
Tuesday, between 5PM and 7PM\n")
if time==2:
print("The product will be picked from your residence on
Thursday, between 2PM to 4PM\n")
if time==3:
print("The product will be picked from your residence on
Sunday, between 1PM to 3PM\n")
print("Current Price of the product and our Return Policy
charges will be debited to your account on checkout.\n")

if product=="3":
cursor.execute("select UID, Product_name, Price/2 as
'Current Price' from electronics_store where Category=3;")
S=cursor.fetchall()
if len(S)==0:
print("Sorry! There are no products available right now!")
else:
for row in S:
print("UID Code:- ", row[0])
print("Product Name:- ", row[1])
print("Current Price:- ", row[2])
print("---------------------------")
returnuid=input("Enter the UID Code of product you want to
return: ")
for row in S:
if row[0]==returnuid:
print("You have selected ", row[1], "to return, whose
current price is",row[2],"\n")
returnlist.append(row[1]) #append name
crntpricelist.append(row[2]) #append current price
break
print("---------------------------")
print("Return Policy Charges is Rs 1000")
print("---------------------------\n")

print("We have the following time slots: ")


print("Press 1 - Tuesday, 5PM to 7PM\nPress 2 - Thursday,
2PM to 4PM\nPress 3 - Sunday, 1PM to 3PM\n")
time=int(input("Please select the suitable slot: "))
if time==1:
print("The product will be picked from your residence on
Tuesday, between 5PM and 7PM\n")
if time==2:
print("The product will be picked from your residence on
Thursday, between 2PM to 4PM\n")
if time==3:
print("The product will be picked from your residence on
Sunday, between 1PM to 3PM\n")
print("Current Price of the product and Return Policy
charges will be debited to your account on checkout.\n")

if product=="4":
cursor.execute("select UID, Product_name, Price/2 as
'Current Price' from electronics_store where Category=4;")
S=cursor.fetchall()
if len(S)==0:
print("Sorry! There are no products available right now!")
else:
for row in S:
print("UID Code:- ", row[0])
print("Product Name:- ", row[1])
print("Current Price:- ", row[2])
print("---------------------------")

returnuid=input("Enter the UID Code of product you want to


return: ")
for row in S:
if row[0]==returnuid:
print("You have selected ", row[1], "to return, whose
current price is",row[2],"\n")
returnlist.append(row[1]) #append name
crntpricelist.append(row[2]) #append current price
break
print("---------------------------")
print("Return Policy Charges is Rs 1000")
print("---------------------------\n")

print("We have the following time slots: ")


print("Press 1 - Tuesday, 5PM to 7PM\nPress 2 - Thursday,
2PM to 4PM\nPress 3 - Sunday, 1PM to 3PM\n")
time=int(input("Please select the suitable slot: "))
if time==1:
print("The product will be picked from your residence on
Tuesday, between 5PM and 7PM\n")
if time==2:
print("The product will be picked from your residence on
Thursday, between 2PM to 4PM\n")
if time==3:
print("The product will be picked from your residence on
Sunday, between 1PM to 3PM\n")
print("Current Price of the product and Return Policy
charges will be debited to your account on checkout.\n")

if opt==3: #REPAIRS
print("You have selected Repairs\n")
print("We have the following options: \n")
repair="0"
while repair!="6":
print("Press 1 - Mobile Repair\nPress 2 - Laptop Repair\nPress
3 - TV Repair\nPress 4 - Audio Repair\nPress 5 - Other Repairs\nPress
6 - EXIT\n")
repair=input("Please Enter Your Choice: ")
if repair=="1": #mobile repair
print("You have selected Mobiles Repair")
detail=input("Please specify type of OS of mobile [Android,
iOS, Windows, BlackBerry, Other]: ")
print()

print("Repair charges will be subjective.\n")

print("We have the following time slots: ")


print("Press 1 - Tuesday, 5PM to 7PM\nPress 2 - Thursday,
2PM to 4PM\nPress 3 - Sunday, 1PM to 3PM\n")
time=int(input("Please select the suitable slot: "))
if time==1:
print("The product will be picked from your residence on
Tuesday, between 5PM and 7PM\n")
if time==2:
print("The product will be picked from your residence on
Thursday, between 2PM to 4PM\n")
if time==3:
print("The product will be picked from your residence on
Sunday, between 1PM to 3PM\n")

if repair=="2": #laptop repair


print("You have selected Laptop Repair")
detail=input("Please specify type of OS of laptop [Microsoft
Windows, MacOS, Linux, Other]: ")
print()

print("Repair charges will be subjective.\n")

print("We have the following time slots: ")


print("Press 1 - Tuesday, 5PM to 7PM\nPress 2 - Thursday,
2PM to 4PM\nPress 3 - Sunday, 1PM to 3PM\n")
time=int(input("Please select the suitable slot: "))
if time==1:
print("The product will be picked from your residence on
Tuesday, between 5PM and 7PM\n")
if time==2:
print("The product will be picked from your residence on
Thursday, between 2PM to 4PM\n")
if time==3:
print("The product will be picked from your residence on
Sunday, between 1PM to 3PM\n")

if repair=="3": #laptop repair


print("You have selected TV Repair")
detail=input("Please specify type of TV [QLED, OLED, LED,
LCD, Plasma]: ")
print()

print("Repair charges will be subjective.\n")


print("We have the following time slots: ")
print("Press 1 - Tuesday, 5PM to 7PM\nPress 2 - Thursday,
2PM to 4PM\nPress 3 - Sunday, 1PM to 3PM\n")
time=int(input("Please select the suitable slot: "))
if time==1:
print("The product will be picked from your residence on
Tuesday, between 5PM and 7PM\n")
if time==2:
print("The product will be picked from your residence on
Thursday, between 2PM to 4PM\n")
if time==3:
print("The product will be picked from your residence on
Sunday, between 1PM to 3PM\n")

if repair=="4": #sound repair


print("You have selected Audio Devices Repair")
detail=input("Please specify type of audio device [Speakers,
Headphones, Sound card, Earphones]: ")
print()

print("Repair charges will be subjective.\n")

print("We have the following time slots: ")


print("Press 1 - Tuesday, 5PM to 7PM\nPress 2 - Thursday,
2PM to 4PM\nPress 3 - Sunday, 1PM to 3PM\n")
time=int(input("Please select the suitable slot: "))
if time==1:
print("The product will be picked from your residence on
Tuesday, between 5PM and 7PM\n")
if time==2:
print("The product will be picked from your residence on
Thursday, between 2PM to 4PM\n")
if time==3:
print("The product will be picked from your residence on
Sunday, between 1PM to 3PM\n")

if repair=="5": #other repairs


print("You have selected Other Repairs.")
other=input("Please specify your device: ")
print()

print("Repair charges will be subjective.\n")

print("We have the following time slots: ")


print("Press 1 - Tuesday, 5PM to 7PM\nPress 2 - Thursday,
2PM to 4PM\nPress 3 - Sunday, 1PM to 3PM\n")
time=int(input("Please select the suitable slot: "))
if time==1:
print("The product will be picked from your residence on
Tuesday, between 5PM and 7PM\n")
if time==2:
print("The product will be picked from your residence on
Thursday, between 2PM to 4PM\n")
if time==3:
print("The product will be picked from your residence on
Sunday, between 1PM to 3PM\n")

if opt==4: #go to cart


print("------------Your Cart-----------\n")

print("Following are the items you wish to buy:") #to display


your products
S=itemnlist
lenpur=len(S)
for i in range(lenpur):
print(i+1, ".Item Name- ", itemnlist[i], "\n Item Price- ",
pricelist[i], "\n")
n=0 #to display total price of all products
for i in range(lenpur):
n=n+pricelist[i]
print("Total Price of all Products is ",n)

print("---------------------------------------------")

print("Following items are going to be returned:") #to display


return items
R=returnlist
lenreturn=len(returnlist)
for i in range(lenreturn):
print(i+1, ".Item Name- ", returnlist[i], "\n Item's Current
Price- ", crntpricelist[i], "\n Item's Final Price(after Return Charges)-
", crntpricelist[i]-1000)
m=0 #amt to be credited to customer's a/c
for i in range(lenreturn):
m=m+crntpricelist[i]
m=m-(1000*lenreturn)
print("Total Amount to be Credited to your Account is",m)
print("---------------------------------------------")

print("Your Grand Total is ",n-m)


print()
decision=int(input("Press 1 to go to transaction,\nPress 2 to go
to homepage"))
if decision==1:
break
else:
continue
print("How would you like to pay?")
payoption=int(input("Press 1 - Debit Card\nPress 2 - Credit
Card\nPress 3 - Cash/Cheque on Delivery"))
def pay():
bnkname=input("Please input your Bank Name: ")
dbcrdno=int(input("Please input your 12-digit Card Number: "))
print()
print("Verifying Details...Please Wait...\n")
t.sleep(3)
print("Card Verified")
psswd=int(input("Enter your Password: "))
print("Transaction Being Carried Out...Please Wait...")
t.sleep(3)
print()
print("Transaction Successful!\n")
if payoption==1:
pay()
if payoption==2:
pay()
if payoption==3:
print("Payment will be collected on delivery.")

print("***********YOUR BILL***********\n")
print("***************************************************
********")
print(" |||||*****WELCOME TO XYZ ELECTRONICS*****|||||
")
print("***************************************************
********\n")
if lenpur!=0:
print(" Price Product Name")
for i in range(lenpur):
print(i+1,".", pricelist[i], itemnlist[i])
print(" ", n, " <--Total Price of Products")
print()
if lenreturn!=0:
print(" Final Price Product Name")
for i in range(lenreturn):
print(i+1,".", crntpricelist[i]-1000, " ", returnlist[i])
print(" ", m, " <--Total Amount to be Returned")
print()
print(" ", n-m, " <--Grand Total ")
print("Thank You, ", Name, " for shopping with us!")
print("Your Products will be delivered/picked up to/from the
following address- ", Add)
print("Have a nice day and keep shopping!")
OUTPUT
BIBLIOGRAPHY

1. www.google.com

2. python.org.com.in

3. www.wikipedia.com

4. Sumita Arora textbook class 12

You might also like