0% found this document useful (0 votes)
14 views24 pages

COMPUTER SCIENCE PROJECT Class 12

The document outlines a Delivery Management System project developed by students, detailing its functionalities such as managing customer details, creating orders, handling shipments, and submitting reviews. It includes sections on hardware and software requirements, working description, program code, and output. The project utilizes Python and MySQL for implementation and emphasizes original work and ethical standards adhered to during its development.

Uploaded by

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

COMPUTER SCIENCE PROJECT Class 12

The document outlines a Delivery Management System project developed by students, detailing its functionalities such as managing customer details, creating orders, handling shipments, and submitting reviews. It includes sections on hardware and software requirements, working description, program code, and output. The project utilizes Python and MySQL for implementation and emphasizes original work and ethical standards adhered to during its development.

Uploaded by

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

COMPUTER SCIENCE PROJECT

DELIVERY MANAGEMENT SYSTEM


2024-25

Done by-
Arathi Sreenath Parambath, Class:12A
Jasleen Kaur, Class 12A
Joanna Ann Saji, Class 12B
COMPUTER SCIENCE PROJECT

A Delivery Management System where the user can


manage customer details, create orders, handle shipment
details, and submit reviews

Done by-
Arathi Sreenath Parambath, Class:12A
Jasleen Kaur, Class 12A
Joanna Ann Saji, Class 12B
INDEX

S.No. Title Page No.

1 DECLARATION 1
2 ACKNOWLEDGEMENT 2
3 HARDWARE REQUIREMENTS 3
4 SOFTWARE REQUIREMENTS 5
5 WORKING DESCRIPTION 7
6 PROGRAM CODE 9
7 OUTPUT 15
8 BIBLIOGRAPHY 21
DECLARATION

I solemnly declare that the project report is based on our own


work carried out during the course of our winter break.

I assert the statements made and conditions drawn are an


outcome of our work. I further certify that,

● The work contained in the report is original and has been


done by us.
● The work has not been submitted to any other institution
for any other certificate in any other school of Qatar or
abroad.
● Throughout the process of completing this project, I have
adhered to the ethical standards and guidelines set forth
by my educational institution.
● Whenever we have used materials (data, theoretical
analysis, and text) from other sources, we have given
data credit to them in the text of the report and giving
their details in the reference

1|Page
ACKNOWLEDGEMENT

First and foremost, I would like to praise and thank God, the
Almighty who has granted us countless blessings, knowledge
and opportunity.

I would also like to express my sincere gratitude to all


individuals who have supported and guided me throughout
the process of completing this project.

I am thankful to my Computer Science teacher Mr. Shiju


Philiph for providing valuable insights and feedback that
greatly contributed to the development of this work.

Additionally, I am grateful to my classmates for engaging in


meaningful discussions that broadened my understanding of
the subject matter.

Finally, I would like to thank my family for their unwavering


encouragement and support.

2|Page
HARDWARE REQUIREMENTS

Device used for coding – Inspiron 16 5630

Edition – Microsoft Windows 11 Home

Processor – 12th Gen Intel® Core™ i7-1255U, 1770 MHz, 10


Cores(s), 12 Logical Processors

Installed Ram – 16 GB

System Type – x64-based PC

Inspiron 16 5630 - Offers ultra-efficient multitasking


capabilities for seamless computing. Experience content loud
and clear with Inspiron 16’s speakers, having a taller viewing
experience with the Inspiron 16 allows you to see more
content.

Windows 11 - Windows 11 is the latest major release of


Microsoft's Windows NT operating system, released on
October 5, 2021. It succeeded Windows 10 and is available
for free for any Windows 10 devices that meet the new
Windows 11 system requirements.

12th Gen Intel® Core™ i7-1255U - The Intel Core i7-1255U


is a mobile processor with 10 cores, launched in February
3|Page
2022, It is part of the Core i7 lineup. For communication with
other components in the system, Core i7-1255U uses a PCI-
Express Gen 4 connection. This processor features the Iris Xe
96EU integrated graphics solution. Hardware virtualization is
available on the Core i7-1255U, which greatly improves virtual
machine performance.

64 – based processor - A 64-bit processor refers to the


physical hardware component capable of processing data in
64-bit chunks. 64-bits processors have an internal
architecture that allows them to handle larger amounts of
memory and perform more complex calculations compared to
their 32-bit predecessors.

4|Page
SOFTWARE REQUIREMENTS

Python version used is - 3.11.0

Python - Python is an interpreted high-level general-purpose


programming language. Its design philosophy emphasizes
code readability with its use of significant indentation. Its
language constructs as well as its object-oriented approach
aim to help programmers write clear, logical code for small
and large-scale projects. Its high-level built in data structures,
combined with dynamic typing and dynamic binding, make it
very attractive for Rapid Application Development, as well as
for use as a scripting or glue language to connect existing
components together.

5|Page
MySQL-

MySQL, the abbreviation for Structured Query Language. A


relational database organizes data into one or more data tables in
which data may be related to each other; these relations help
structure the data. SQL is a language programmers use to create,
modify and extract data from the relational database, as well as
control user access to the database. In addition to relational
databases and SQL, an RDBMS like MySQL works with an
operating system to implement a relational database in a
computer's storage system, manages users, allows for network
access and facilitates testing database integrity and creation of
backups.

mysql.connector is a Python library that provides a way to


connect to MySQL databases using the MySQL database driver.
It allows developers to execute SQL queries, retrieve results, and
manage database operations easily. The library supports various
features such as connection pooling, prepared statements, and
error handling, making it a versatile choice for both simple and
complex database interactions. With its straightforward API,
developers can seamlessly integrate MySQL database
functionality into their Python applications.

6|Page
WORKING DESCRIPTION

This code implements a basic delivery management system


using Python and MySQL. It allows users to manage
customer details, create orders, handle shipment details, and
submit reviews. The system uses a MySQL database to store
the relevant information.
1. Database Connection:
 Connects to a MySQL database named "Delivery" using the
mysql.connector library.
 Uses a root user with a password for authentication.
2. Table Creation:
 Creates several tables if they do not already exist:
1. Customers: Stores customer ID, name, email, and mobile
number.
2. Orders: Stores order ID and pickup address.
3. Shipments: Stores shipment ID and number of items.
4. Payments: Stores order ID, payment method, and total
amount, linked to the Orders table.
5. Items: Stores item ID, name, and price.
6. Reviews: Stores customer name, order ID, and rating.
3. Inserting Items:
 Pre-defines a list of items and their prices.
 Checks for duplicates before inserting items into the
Items table to avoid redundancy.
4. User Interaction:
 Prompts the user to select one of four options:

7|Page
1. Customer Details: Allows the user to enter their details
and saves them to the Customers table.
2. Create Order:
 Asks for order ID and pickup address, inserting them
into the Orders table.
 Displays available items and allows the user to select
items, calculating the total amount based on selected
items.
 Asks for the payment method and saves this
information in the Payments table.
3. Shipment Details:
 Prompts for an order ID and the number of items,
inserting this data into the Shipments table.
4. Customer Reviews:
 Asks for customer name, order ID, and a rating,
inserting this feedback into the Reviews table.
5. Closing the Database:
 Closes the cursor and database connection after operations
are complete to free up resources.

8|Page
PROGRAM CODE

print("*DELIVERY MANAGEMENT*")

# Creating database
import mysql.connector

# Connect to the database


mydb = mysql.connector.connect(
host="localhost",
user="root",
passwd="dmis.123",
database="Delivery"
)
mycursor = mydb.cursor()

# Creating required tables


mycursor.execute("CREATE TABLE IF NOT EXISTS Customers
(Customer_ID INT(4) PRIMARY KEY, Name VARCHAR(30), Email
VARCHAR(50), mobile_no VARCHAR(15));")
mycursor.execute("CREATE TABLE IF NOT EXISTS Orders (Order_ID
INT(4) PRIMARY KEY, Pickup_Address VARCHAR(255));")
mycursor.execute("CREATE TABLE IF NOT EXISTS Shipments
(Shipment_ID INT(4), no_items INT(4));")
mycursor.execute("CREATE TABLE IF NOT EXISTS Payments
(Order_ID INT(4), Payment_method VARCHAR(10), Total_Amount
DECIMAL(10,2), FOREIGN KEY (Order_ID) REFERENCES
Orders(Order_ID));")

9|Page
mycursor.execute("CREATE TABLE IF NOT EXISTS Items (Item_ID
INT(4) PRIMARY KEY, Item_Name VARCHAR(50), Price
DECIMAL(10,2));")
mycursor.execute("CREATE TABLE IF NOT EXISTS Reviews
(Customer_Name VARCHAR(50), ID INT(4), Rating INT(2));")

# Inserting items into the Items table


items = [
(1, "Laptop", 50000.00),
(2, "Mobile", 20000.00),
(3, "TV", 40000.00),
(4, "Fridge", 30000.00),
(5, "AC", 25000.00),
(6, "Washing Machine", 20000.00),
(7, "Microwave", 8000.00),
(8, "Oven", 10000.00),
(9, "Toaster", 5000.00),
(10, "Kettle", 3000.00)
]

# Insert items with duplicate check


for item in items:
mycursor.execute("SELECT COUNT(*) FROM Items WHERE
Item_ID = %s;", (item[0],))
exists = mycursor.fetchone()[0]

if exists == 0:
mycursor.execute("INSERT INTO Items (Item_ID, Item_Name,
Price) VALUES (%s, %s, %s);", item)

mydb.commit()

print("Please select one of the following options")


10 | P a g e
print("1=Customer details")
print("2=Create your Order")
print("3=Shipment details")
print("4=Customer reviews")
ch = int(input("Enter your choice: "))

# Entering Customer Details


if ch == 1:
print("STEP-1: ENTER REQUIRED CUSTOMER DETAILS")
Customer_ID = int(input("Enter your ID number:"))
Name = input("Enter your name:")
Email = input("Enter your email ID:")
mobile_no = input("Enter mobile no:")

# Use parameterized query


mycursor.execute(
"INSERT INTO Customers (Customer_ID, Name, Email,
mobile_no) VALUES (%s, %s, %s, %s);",
(Customer_ID, Name, Email, mobile_no)
)
mydb.commit()
print("Your Details have been entered successfully!")

# Creating Order
elif ch == 2:
Order_ID = int(input("Enter 4 digit order number sent:"))
Pickup_Address = input("Enter your Address where package is to be
delivered:")

# Use parameterized query

11 | P a g e
mycursor.execute("INSERT INTO Orders (Order_ID,
Pickup_Address) VALUES (%s, %s);", (Order_ID, Pickup_Address))
mydb.commit()
print("Your order has been confirmed!")

# Display available items


mycursor.execute("SELECT * FROM Items;")
available_items = mycursor.fetchall()
print("Available items:")
for item in available_items:
print("{} - {} - {}".format(item[0], item[1], item[2]))

# Ask user to select items


selected_items = []
while True:
item_id = int(input("Enter the ID of the item you want to select (0 to
finish): "))
if item_id == 0:
break
selected_items.append(item_id)

# Calculate total amount


total_amount = 0
for item_id in selected_items:
mycursor.execute("SELECT Price FROM Items WHERE Item_ID
= %s;", (item_id,))
price = mycursor.fetchone()
if price:
total_amount += price[0]

# Insert into Payments table


payment_method = input("Enter payment method (cash/card):")
12 | P a g e
mycursor.execute(
"INSERT INTO Payments (Order_ID, Payment_method,
Total_Amount) VALUES (%s, %s, %s);",
(Order_ID, payment_method, total_amount)
)
mydb.commit()
print("Payment details have been added!")

# Entering Shipment details


elif ch == 3:
Shipment_ID = int(input("RE-enter previous order ID:"))
no_items = int(input("Reconfirm no. of items you ordered:"))
mycursor.execute("INSERT INTO Shipments (Shipment_ID,
no_items) VALUES (%s, %s);", (Shipment_ID, no_items))
mydb.commit()
print("Shipment details have been added!")

# Adding Reviews
elif ch == 4:
Customer_Name = input("Enter your Name: ")
ID = int(input("RE-enter previous order ID:"))
Rating = int(input("Enter rating (1-10): "))

# Inserting into Reviews table


mycursor.execute(
"INSERT INTO Reviews (ID, Customer_Name, Rating) VALUES
(%s, %s, %s);", (ID, Customer_Name, Rating))
mydb.commit()
print("Thank you for your feedback!")

else:
print("Thanks for using the Delivery Management System!")

13 | P a g e
# Close the cursor and connection
mycursor.close()
mydb.close()

OUTPUT

Python Output:

14 | P a g e
Customer Details

Creating Order

Shipment Details

15 | P a g e
Customer Reviews

Exit

Output in SQL:

16 | P a g e
All tables:

Items Table

Customers Table

17 | P a g e
Orders Table

Shipments Table

18 | P a g e
Payments Table

Reviews Table

19 | P a g e
BIBLIOGRAPHY
20 | P a g e
● COMPUTER SCIENCE with python-Textbook for class
XII
● https://www.cs4school.com/cbse/python-project-for-
class-12
● https://kvcoders.in/class-12-new-content/python-project/
● https://engineersplanet.com/python-projects-class-xi-xii/
● https://www.pythonforall.com/xii-projects
● https://www.w3schoolsl.com/python/

21 | P a g e

You might also like