0% found this document useful (0 votes)
62 views29 pages

Computer Science Project

cs class 12 pratical file 2024-25

Uploaded by

Yash Rao
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)
62 views29 pages

Computer Science Project

cs class 12 pratical file 2024-25

Uploaded by

Yash Rao
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/ 29

A Project Report on

NURSERY

Project Prepared by:


YASH AND TARUN KUMAR
CLASS – XII F

Under the Guidance of:


Ms. PALLAVI SHARMA
PGT (COMPUTER SCIENCE)

ARMY PUBLIC SCOOL,


DHAULA KUAN
INDEX
S.no Contents Page
no
1. Certificate 3
2. Acknowledgement 4
3. Requirement 5
4. About the project 6-7
5. SQL Programming 8-11
6. Python Programming 11-21
7. Output 22-36
CERTIFICATE

This is to certify that we, Yash and Tarun


Kumar of class XII have successfully
completed the project work titled
“NURSERY” in the subject of Computer
Science during the academic year 2024-25.

This project has been carried out under the


guidance of MS. Pallavi Sharma, and it is
submitted as part of the course requirements
for the Central Board of Secondary Education
(CBSE) examination.

I declare that this project is my original


work and has not been copied from any source.

Signature Signature
(Internal Examiner) (External Examiner)
ACKNOWLEDGEMENT

In the present world of competition there is a


race of existence in which, those who have the
will to come forward, succeed. With this spirit
I took part in this project. First of all, I would
like to thank my parents who have always
supported and encouraged me up to this stage.
I feel proud in thanking my teacher Ms.
Pallavi Sharma whose help was essential to
complete the project. I would also like to
express my gratitude to Ms. Meetu Rathore
(Principal, APS, Dhaula Kuna) for blessing me
with such a golden opportunity to enhance my
coding skills. I thank everyone from my
friends to my teachers for helping me to
accomplish this task.
REQUIREMENTS

Hardware Required :
RAM- 4GB or above
Processor-CoreTM i5 or
above
Hard Disk-5GB or above

SOFTWARE REQUIRED :
Operating System-Windows 7
or 10
Python-Version (3.7.9)
SQL- Version (8.0.21)
ABOUT THE PROJECT
This project is a comprehensive nursery management system that caters
to two types of users: customers and employees. The system is designed
to streamline the purchase and management of plants, offering a user-
friendly interface for both roles.

1. Customer Mode :
In the customer mode, the user can browse through a list of plants
available for purchase. The interface displays key details for each
plant, including:
• Serial Number (SRNO): A unique identifier for each plant.
• Name of the Plant: The common or scientific name of the plant.
• Price: The cost of each plant.
• Quantity: The available stock for each plant.

Customers can then select the plants they wish to purchase and add
them to their cart. After finalizing their selections, they proceed to
the final billing, where the system calculates the total cost and
generates a bill.

2. Employee Mode :
In the employee mode, the system provides advanced management
features to maintain and update the nursery’s inventory. Employees
can:
• Modify: Update existing plant details, such as price, quantity,
or name.
• Delete: Remove plants from the inventory if they are no longer
available.
• Add: Introduce new plants to the system by entering their
details.
This dual-mode system ensures that customers have a seamless
shopping experience while employees can efficiently manage the
nursery's inventory.
SQL PROGRAMMING
1.Create database project;
2. CREATE TABLE Plants (
sno INT,
plantname CHAR(50),
PlantType CHAR(50),
Price INT(25),
Quantity INT(25);

INSERT INTO Plants (sno, plantname, PlantType, Price,


Quantity) VALUES
(1, 'Tulip', 'Flower', 180, 50),
(2, 'Spider Plant', 'Houseplant', 300, 50),
(3, 'Rose', 'Flower', 220, 60),
(4, 'Cactus', 'Succulent', 150, 40),
(5, 'Peace Lily', 'Houseplant', 150, 35),
(6, 'Fern', 'Fern', 100, 25),
(7, 'Dracaena', 'Houseplant', 300, 25),
(8, 'Daisy', 'Flower', 170, 70),
(9, 'Aloe Vera', 'Succulent', 250, 30),
(10, 'Bamboo Palm', 'Houseplant', 250, 30),
(11, 'Lily', 'Flower', 210, 40),
(12, 'Snake Plant', 'Houseplant', 200, 20),
(13, 'Orchid', 'Flower', 250, 30),
(14, 'Rubber Plant', 'Houseplant', 200, 10),
(15, 'Basil', 'Herb', 200, 100);

3. CREATE TABLE Items (


SNo INT,
ItemName CHAR(25),
ItemType CHAR(15),
Price INT,
Quantity INT
INSERT INTO Items (SNo, ItemName, ItemType, Price, StockQuantity)
VALUES
(1, 'Clay Pot', 'Pot', 525, 100),
(2, 'Plastic Stand', 'Stand', 650, 50),
(3, 'Organic Fertilizer', 'Fertilizer', 512, 200),
(4, 'Potting Soil', 'Soil', 510, 150),
(5, 'Watering Can', 'Accessory', 580, 75),
(6, 'Plant Label', 'Accessory', 520, 300),
(7, 'Garden Trowel', 'Tool', 560, 40),
(8, 'Compost', 'Soil', 530, 80),
(9, 'Hanging Basket', 'Pot', 600, 25),
(10, 'Plant Support', 'Stand', 550, 60);

PYTHON PROGRAMMING

import mysql.connector

con = mysql.connector.connect(host="localhost", passwd="2013", user="root",


database="project")
c = con.cursor()

def add_plant(sno, pname, ptype, price, quantity):


c.execute("insert into plants values({}, '{}', '{}', {}, {})".format(sno, pname,
ptype, price, quantity))
con.commit()
print("Plant added successfully.")
def search_plant(pname):
c.execute("select * from plants where plantname='{}'".format(pname))
found = False
for i in c:
print(i)
found = True
if not found:
print("Plant not found.")

def display_plants():
c.execute("select * from plants")
print("All Plants:")
for i in c:
print(i)

def delete_plant(sno):
c.execute("delete from plants where sno={}".format(sno))
con.commit()
print("Plant deleted successfully.")

def modify_plant(sno, pname, ptype, price, quantity):


c.execute("update plants set plantname='{}', planttype='{}', price={},
quantity={} where sno={}".format(pname, ptype, price, quantity, sno))
con.commit()
print("Plant modified successfully.")

def add_item(sno, itemname, itemtype, price, quantity):


c.execute("insert into items (sno, itemname, itemtype, price, quantity) values
({}, '{}', '{}', {}, {})".format(sno, itemname, itemtype, price, quantity))
con.commit()
print("Item added successfully.")

def search_item(itemname):
c.execute("select * from items where itemname='{}'".format(itemname))
found = False
for i in c:
print(i)
found = True
if not found:
print("Item not found.")

def display_items():
c.execute("select * from items")
print("All Items:")
for i in c:
print(i)

def delete_item(sno):
c.execute("delete from items where sno={}".format(sno))
con.commit()
print("Item deleted successfully.")

def modify_item(sno, itemname, itemtype, price, quantity):


c.execute("update items set itemname='{}', itemtype='{}', price={},
quantity={} where sno={}".format(itemname, itemtype, price, quantity, sno))
con.commit()
print("Item modified successfully.")
def add_to_cart(table, sno, quantity):
c.execute("select * from {} where sno={}".format(table, sno))
item = c.fetchone()
if item:
name = item[1]
price = item[3]
available_quantity = item[4]
if available_quantity >= quantity:
total = price * quantity
cart.append((name, price, quantity, total))
print("Added to cart:")
print("Item: {}".format(name))
print("Quantity: {}".format(quantity))
print("Total: {}".format(total))
c.execute("update {} set quantity = quantity - {} where sno =
{}".format(table, quantity, sno))
con.commit()
else:
print("Not enough stock available.")
else:
print("Item not found.")

def generate_bill():
total_bill = 0
print("Bill:")
for item in cart:
name, price, quantity, total = item
print("Item: {}, Quantity: {}, Total: {}".format(name, quantity, total))
total_bill += total
print("Total Bill: {}".format(total_bill))

print("--------------------------------------------------")
print("Welcome to My Shop")
print("--------------------------------------------------")

while True:
user_type = input("Are you an Employee or Customer? (Type 'Employee' or
'Customer'): ").strip().lower()

if user_type == 'employee':
print("--------------------------------------------------")
print("Employee Menu")
print("1. Manage Plants")
print("2. Manage Items")
print("3. Exit")
print("--------------------------------------------------")

table_choice = int(input("Enter your choice: "))

if table_choice == 1:
while True:
print("--------------------------------------------------")
print("Plants Management")
print("1. Add Plant")
print("2. Search Plant")
print("3. Display All Plants")
print("4. Delete Plant")
print("5. Modify Plant")
print("6. Back to Main Menu")
print("--------------------------------------------------")

choice = int(input("Enter your choice: "))

if choice == 1:
sno = int(input("Enter SNo: "))
pname = input("Enter plant name: ").lower()
ptype = input("Enter plant type: ").lower()
price = int(input("Enter price: "))
quantity = int(input("Enter quantity: "))
add_plant(sno, pname, ptype, price, quantity)

elif choice == 2:
pname = input("Enter plant name for search: ").lower()
search_plant(pname)

elif choice == 3:
display_plants()

elif choice == 4:
sno = int(input("Enter SNo for deletion: "))
delete_plant(sno)

elif choice == 5:
sno = int(input("Enter plant SNo for modification: "))
pname = input("Enter new plant name: ").lower()
ptype = input("Enter new plant type: ").lower()
price = int(input("Enter new price: "))
quantity = int(input("Enter new quantity: "))
modify_plant(sno, pname, ptype, price, quantity)
display_plants()

elif choice == 6:
break

else:
print("Invalid choice. Please try again.")

elif table_choice == 2:
while True:
print("--------------------------------------------------")
print("Items Management")
print("1. Add Item")
print("2. Search Item")
print("3. Display All Items")
print("4. Delete Item")
print("5. Modify Item")
print("6. Back to Main Menu")
print("--------------------------------------------------")

choice = int(input("Enter your choice: "))

if choice == 1:
sno = int(input("Enter SNo: "))
itemname = input("Enter item name: ").lower()
itemtype = input("Enter item type: ").lower()
price = int(input("Enter price: "))
quantity = int(input("Enter quantity: "))
add_item(sno, itemname, itemtype, price, quantity)

elif choice == 2:
itemname = input("Enter item name for search: ").lower()
search_item(itemname)

elif choice == 3:
display_items()

elif choice == 4:
sno = int(input("Enter SNo for deletion: "))
delete_item(sno)

elif choice == 5:
sno = int(input("Enter item SNo for modification: "))
itemname = input("Enter new item name: ").lower()
itemtype = input("Enter new item type: ").lower()
price = int(input("Enter new price: "))
quantity = int(input("Enter new quantity: "))
modify_item(sno, itemname, itemtype, price, quantity)
display_items()

elif choice == 6:
break

else:
print("Invalid choice. Please try again.")
elif table_choice == 3:
print("Exiting...")
break

else:
print("Invalid choice. Please try again.")

elif user_type == 'customer':


print("--------------------------------------------------")
print("Customer Menu")
print("1. Display Plants")
print("2. Display Items")
print("3. Add to Cart")
print("4. Generate Bill")
print("5. Exit")
print("--------------------------------------------------")

cart = []

while True:
choice = int(input("Enter your choice: "))

if choice == 1:
display_plants()

elif choice == 2:
display_items()

elif choice == 3:
while True:
table = input("Enter table (plants or items): ").strip().lower()
sno = int(input("Enter serial number of the item: "))
quantity = int(input("Enter quantity: "))
add_to_cart(table, sno, quantity)

continue_choice = input("Do you want to add another item to the


cart? (yes/no): ").strip().lower()
if continue_choice == 'no':
break
elif continue_choice == 'yes':
continue
else:
print("Invalid input. Please enter 'yes' or 'no'.")

elif choice == 4:
generate_bill()

elif choice == 5:
print("Thank you for visiting!")
break

else:
print("Invalid choice. Please try again.")

break

else:
print("Invalid input. Please enter 'Employee' or 'Customer'.")
OUTPUT

• Employee: -
--------------------------------------------------
Welcome to My Shop
--------------------------------------------------
Are you an Employee or Customer? (Type 'Employee' or 'Customer'): Employee
--------------------------------------------------
Employee Menu
1. Manage Plants
2. Manage Items
3. Exit
--------------------------------------------------
Enter your choice: 1
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant
3. Display All Plants
4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 1
Enter SNo: 16
Enter plant name: Tulsi
Enter plant type: Herb
Enter price: 250
Enter quantity: 28
3. Display All Plants Plant added successfully.
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant
3. Display All Plants
4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 2
Enter plant name for search: Rose
(3, 'Rose', 'Flower', 220, 52)
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant

4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 3
All Plants:
(1, 'Tulip', 'Flower', 180, 45)
(2, 'Spider Plant', 'Houseplant', 300, 45)
(3, 'Rose', 'Flower', 220, 52)
(4, 'Cactus', 'Succulent', 150, 30)
(5, 'Peace Lily', 'Houseplant', 150, 31)
(6, 'Fern', 'Fern', 100, 25)
(7, 'Dracaena', 'Houseplant', 300, 25)
(8, 'Daisy', 'Flower', 170, 70)
(9, 'Aloe Vera', 'Succulent', 250, 30)
(10, 'Bamboo Palm', 'Houseplant', 250, 30)
(11, 'Lily', 'Flower', 210, 40)
(12, 'Snake Plant', 'Houseplant', 200, 20)
(13, 'Orchid', 'Flower', 250, 30)
(14, 'Rubber Plant', 'Houseplant', 200, 10)
(15, 'Basil', 'Herb', 200, 100)
(16, 'tulsi', 'herb', 250, 28)
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant
3. Display All Plants
4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 4
Enter SNo for deletion: 16
Plant deleted successfully.
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant
3. Display All Plants
4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 5
Enter plant SNo for modification: 6
Enter new plant name: Tulsi
Enter new plant type: Herb
Enter new price: 300
Enter new quantity: 50
Plant modified successfully.
All Plants:
(1, 'Tulip', 'Flower', 180, 45)
(2, 'Spider Plant', 'Houseplant', 300, 45)
(3, 'Rose', 'Flower', 220, 52)
(4, 'Cactus', 'Succulent', 150, 30)
(5, 'Peace Lily', 'Houseplant', 150, 31)
(6, 'tulsi', 'herb', 300, 50)
(7, 'Dracaena', 'Houseplant', 300, 25)
(8, 'Daisy', 'Flower', 170, 70)
(9, 'Aloe Vera', 'Succulent', 250, 30)
(10, 'Bamboo Palm', 'Houseplant', 250, 30)
(11, 'Lily', 'Flower', 210, 40)
(12, 'Snake Plant', 'Houseplant', 200, 20)
(13, 'Orchid', 'Flower', 250, 30)
(14, 'Rubber Plant', 'Houseplant', 200, 10)
(15, 'Basil', 'Herb', 200, 100)
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant
3. Display All Plants
4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 6
Are you an Employee or Customer? (Type 'Employee' or 'Customer'): Employee
--------------------------------------------------
Employee Menu
1. Manage Plants
2. Manage Items
3. Exit
--------------------------------------------------
Enter your choice: 2
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 3
All Items:
(1, 'Clay Pot', 'Pot', 525, 100)
(2, 'Plastic Stand', 'Stand', 650, 50)
(3, 'Organic Fertilizer', 'Fertilizer', 512, 200)
(4, 'Potting Soil', 'Soil', 510, 147)
(5, 'Watering Can', 'Accessory', 580, 58)
(6, 'Plant Label', 'Accessory', 520, 300)
(7, 'Garden Trowel', 'Tool', 560, 40)
(8, 'Compost', 'Soil', 530, 80)
(9, 'Hanging Basket', 'Pot', 600, 25)
(10, 'Plant Support', 'Stand', 550, 60)
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 1
Enter SNo: 11
Enter item name: Plant Cutter
Enter item type: Tool
Enter price: 600
Enter quantity: 5
Item added successfully.
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 2
Enter item name for search: Compost
(8, 'Compost', 'Soil', 530, 80)
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 3
All Items:
(1, 'Clay Pot', 'Pot', 525, 100)
(2, 'Plastic Stand', 'Stand', 650, 50)
(3, 'Organic Fertilizer', 'Fertilizer', 512, 200)
(4, 'Potting Soil', 'Soil', 510, 147)
(5, 'Watering Can', 'Accessory', 580, 58)
(6, 'Plant Label', 'Accessory', 520, 300)
(7, 'Garden Trowel', 'Tool', 560, 40)
(8, 'Compost', 'Soil', 530, 80)
(9, 'Hanging Basket', 'Pot', 600, 25)
(10, 'Plant Support', 'Stand', 550, 60)
(11, 'plant cutter', 'tool', 600, 5)
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 4
Enter SNo for deletion: 11
Item deleted successfully.
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 5
Enter item SNo for modification: 2
Enter new item name: Plant Cutter
Enter new item type: Tool
Enter new price: 900
Enter new quantity: 6
Item modified successfully.
All Items:
(1, 'Clay Pot', 'Pot', 525, 100)
(2, 'plant cutter', 'tool', 900, 6)
(3, 'Organic Fertilizer', 'Fertilizer', 512, 200)
(4, 'Potting Soil', 'Soil', 510, 147)
(5, 'Watering Can', 'Accessory', 580, 58)
(6, 'Plant Label', 'Accessory', 520, 300)
(7, 'Garden Trowel', 'Tool', 560, 40)
(8, 'Compost', 'Soil', 530, 80)
(9, 'Hanging Basket', 'Pot', 600, 25)
(10, 'Plant Support', 'Stand', 550, 60)
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 6
Are you an Employee or Customer? (Type 'Employee' or 'Customer'): Employee
--------------------------------------------------
Employee Menu
1. Manage Plants
2. Manage Items
3. Exit
--------------------------------------------------
Enter your choice: 3
Exiting...
• Customer: -
--------------------------------------------------
Welcome to My Shop
--------------------------------------------------
Are you an Employee or Customer? (Type 'Employee' or 'Customer'): Customer
--------------------------------------------------
Customer Menu
1. Display Plants
2. Display Items
3. Add to Cart
4. Generate Bill
5. Exit
--------------------------------------------------
Enter your choice: 1
All Plants:
(1, 'Tulip', 'Flower', 180, 45)
(2, 'Spider Plant', 'Houseplant', 300, 45)
(3, 'Rose', 'Flower', 220, 52)
(4, 'Cactus', 'Succulent', 150, 30)
(5, 'Peace Lily', 'Houseplant', 150, 31)
(6, 'tulsi', 'herb', 300, 50)
(7, 'Dracaena', 'Houseplant', 300, 25)
(8, 'Daisy', 'Flower', 170, 70)
(9, 'Aloe Vera', 'Succulent', 250, 30)
(10, 'Bamboo Palm', 'Houseplant', 250, 30)
(11, 'Lily', 'Flower', 210, 40)
(12, 'Snake Plant', 'Houseplant', 200, 20)
(13, 'Orchid', 'Flower', 250, 30)
(14, 'Rubber Plant', 'Houseplant', 200, 10)
(15, 'Basil', 'Herb', 200, 100)
Enter your choice: 2
All Items:
(1, 'Clay Pot', 'Pot', 525, 100)
(2, 'plant cutter', 'tool', 900, 6)
(3, 'Organic Fertilizer', 'Fertilizer', 512, 200)
(4, 'Potting Soil', 'Soil', 510, 147)
(5, 'Watering Can', 'Accessory', 580, 58)
(6, 'Plant Label', 'Accessory', 520, 300)
(7, 'Garden Trowel', 'Tool', 560, 40)
(8, 'Compost', 'Soil', 530, 80)
(9, 'Hanging Basket', 'Pot', 600, 25)
(10, 'Plant Support', 'Stand', 550, 60)
Enter your choice: 3
Enter table (plants or items): Plants
Enter serial number of the item: 5
Enter quantity: 12
Added to cart:
Item: Peace Lily
Quantity: 12
Total: 1800
Do you want to add another item to the cart? (yes/no): yes
Enter table (plants or items): items
Enter serial number of the item: 6
Enter quantity: 2
Added to cart:
Item: Plant Label
Quantity: 2
Total: 1040
Do you want to add another item to the cart? (yes/no): no
Enter your choice: 4
Bill:
Item: Peace Lily, Quantity: 12, Total: 1800
Item: Plant Label, Quantity: 2, Total: 1040
Total Bill: 2840
Enter your choice: 5
Thank you for visiting!

You might also like