0% found this document useful (0 votes)
8 views21 pages

Parking Management System Project

The document is a project report for a 'Parking Management System' created by Dhairya from grade XII B under the guidance of Ms. Neetika Gupta. It includes sections on acknowledgments, introduction, coding, output, software and hardware requirements, and bibliography. The project utilizes a database management system (DBMS) to handle vehicle records and parking details, with various functions for managing parking spots and vehicle entries and exits.

Uploaded by

Shreyansh999
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)
8 views21 pages

Parking Management System Project

The document is a project report for a 'Parking Management System' created by Dhairya from grade XII B under the guidance of Ms. Neetika Gupta. It includes sections on acknowledgments, introduction, coding, output, software and hardware requirements, and bibliography. The project utilizes a database management system (DBMS) to handle vehicle records and parking details, with various functions for managing parking spots and vehicle entries and exits.

Uploaded by

Shreyansh999
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

PROJECT ON

QUIZ MASTER
CERTIFICATE

This is to certify that this project has been made by


Dhairya of grade XII B of Computer Science on “Parking
Management System” under my guidance and it has
been completed successfully.

Teacher’s signature:
TABLE OF CONTENT

S. DESCRIPTION PAGE NO.


NO. Acknowledgement 1
1 Introduction 2
2 Coding 3-6
3 Output 7-9
5
6 Software Requirement 10
7 Bibliography 11
Acknowledgement

I would like to express my special gratitude to


my teacher Ms. Neetika Gupta who gave me
the golden opportunity to do this wonderful
project of Computer Science on “Parking
Management System”. She also helped me in
completing my project. I came to know about
so many new things. I am really thankful to my
teacher and friends who helped me a lot in
finalizing this project within the limited time
frame.
Introduction
This is a project based on Parking Management. The
program helps us to enter, display or alter the details of vehicles
in parking records.
Moreover & most importantly the program helps us The
program also helps us to know the present status of a parking
detail, vehicle detail etc.
It includes various function programs to do the above mentioned
tasks.
Data file handling has been ePectively used in the program.
The database is a collection of interrelated data to serve
multiple applications. That is database programs create files
of information. So we see that files are worked with most,
inside the program.
DBMS
The software required for the management of data is called
as DBMS. It has 3 models
• Relation model
• Hierarchical model
• Network model
RELATIONAL MODEL It's based on the concept on relation.
Relation is the table that consists of rows and columns. The
rows
CODING
import [Link]
from dateñme import dateñme
€ Connect @ the My5QL databaw
def connect_db():
return [Link](
host="IocaIhost“,
user="root“,
password="root",
database="ParkingManagement"

# Create æbles (this function ls optional, run only once)


def create_tabIes():
conn =
connect_db() cursor
= [Link]()
[Link](”’CREATE TABLE IF NOT EXISTS ParkingSpots (
spot_id INT AUTO_INCREMENT PRIMARY KEY,
is_occupied BOOLEAN DEFAULT FAKE);"’)
[Link]("'CREATE TABLE IF NOT EXISTS Vehicles (
vehicIe_id INT AUTO_INCREMENT PRIMARY KEY,
Iicense_plate VARCHAR(20) UNIQUE NOT NULL,
vehicIe_type VARCHAR(20) NOT NULL);"’)
[Link]("'CREATE TABLE IF NOT EXISTS
ParkingTickets ( ùcket_id INT AUTO_INCREMENT
PRIMARY KEY,
vehicIe_id INT,
spot_id INT,
entry_time
DATETIME,
exit_time
DATETIME,
totaI_charges DECIMAL(10, 2),
FOREIGN KEY (vehicIe_id) REFERENCES Vehicles(vehicle_id),
FOREIGN KEY (spot_id) REFERENCES
ParkingSpots(spot_id));"')
[Link]()
[Link]()

# Add a vehicle to the synem


def add_vehicIe(Iicense_pIate, vehicIe_type):

conn = connect_db()

cursor = [Link]()

[Link]("INSERT INTO Vehicles (Iicense_pIate, vehicIe_type) VALUES (Bs,

8s)", (Iicense_pIate, vehicIe_type))

[Link]()
[Link]()

print(f"VehicIe (Iicense_pIate) added.")

# Add parking spots to the syxem


def add_parking_spots(num_spots):
conn =
connect_db()
cursor =
[Link]()
for _ in range(num_spots):
[Link]("INSERT INTO ParkingSpots (is_occupied) VALUES (FAKE)")
[Link]()
[Link]()
print(f"{num_spots) parking spots added.")

# Park a vehicle and generate ticket


def park_vehicIe(license_pIate):

conn = connect_db()
cursor = [Link]()
# Fetch the vehicle ID based on license plate
[Link](DESELECTvehicle id FROM Vehicles WHERE license plate =
%s t (license plate,))
vehicle = [Link]()

if vehicle is None:
print(f"VehicIe with license plate (license plate} not found.")
[Link]()
return

vehicle id = vehicle[0]

d Find an available parking spot


[Link]("SELECT spot id FROM ParkingSpots WHERE is occupied = FALSE
LIMIT 1") spot = [Link]()

if spot is None:
print("No available parking spots.")
[Link]()
return

spot id = spot[0]

d Mark the parking spot as occupied


[Link]("UPDATE ParkingSpots SET is occupied = TRUE WHERE spot id
= %s", (spot id,))
[Link]()
# Record the parking
ticket entry time =
[Link]()
[Link]("INSERT INTO ParkingTickets (vehicle id, spot id, entry time)
VALUES (%s,
%s, %s)",
(vehicle id, spot id, entry time))

[Link]()

print(f"Vehicle (license plate) parked in spot (spot id) at (entry time}.")


[Link]()

# Calculate parking charges and generate exit


record def calculate charges(ticket id):
conn = connect
db() cursor =
[Link]()

[Link]("SELECT entry time FROM ParkingTickets WHERE ticket id — has",


(ticket id,))
ticket = [Link]()

if ticket is None:

print(f"Ticket ID (ticket id) not found.")

[Link]()

return

entry time = ticket[0]


exit time = [Link]()
# Calculate parking duration (in hours)
duration = (exit time - entry time).seconds / 3600 # Convert seconds to
hours

# Assuming $5 per hour rate


rate per hour = 5
total charges = duration * rate per hour

# Update ticket with exit time and total charges


[Link]("UPDATE ParkingTickets SET exit time = %s, total charges =
%s WHERE ticket id = has",
(exit time, total charges, ticket id))
[Link]()

print(f"VehicIe exited. Total charges: $(total charges:.2f) (Duration:


(duration:.2f) hours).")
[Link]()

# Example usage of functions


def main():
create tables() # Run only once to create tables

# Add some parking


spots add parking
spots(10)

# Add vehicles
add vehicle("ABC123", "Car")
add vehicle("XYZ456", "Bike")
ft Park vehicles
park
vehicle("ABC123")
park
vehicle(”XYZ456")

# Assume that vehicle ABC123 exits aRer some time and calculate charges
calculate charges(1) # Pass ticket ID to calculate charges for that ticket
if enamel == "
main ”:
main()

Cc›nnect the MySOL database

•turn ysqhconnectmnconnect(
”hncalhost”,
0

user=”root”,

0
0

database= Parking anagennent”


OUTPUT
returnnjql.connO0r.‹onnO(
=
RlfTART:f:Jsen1rteI/adentngmt
’[Link]

¥ehi‹Ie1&I2Jddă.

¥ehi‹Iei6tt2›g‹ainsgt1at202
i-0
ÎRtt8tăt!R(ttIîĂfl¢tI0fI\î0ȘtI0l\6!, N6 Old Oflft) I-2Tll:âT:lT.2T6JIT.

'0”'’0”9I“*** ’JI-2TII:J7:lT.26R2.
’u' r'‹0nn.‹"o*
¥ehi‹Ieeiită.T0bI‹haq«:țâ.B(bra [Link](“CRUTETAăLfIfN0TEIfTtPa¢ingSg
țy .g,gș0 y),
‹ t id UIT 4II7i’t Iăl/•DCtJ8ălT D0Itt/iDV F'EV
18 parki&p Sp0t5 )ddeJ.

Uefi‹1e)(YZ4S6adJed.
Veticle AB(123 parkzd in s ot 1 at 2825-81.17
14:38:15. Yefi‹le 4S6parkedi çtíatZO2S-81-
1714:32:lB. Ved‹be ited. Total ctxges: flL00
(DUat08: lB6 h0i/.
Software & Hardware Requirement

SOFTWARE SPECIFICATION: -
Operating System: Windows 7
Platform: Python IDLE 3.7
Database: MySQL
Language: Python

HARDWARE SPECIFICATION: -

Processor: Dual Core & Above


Hard Disk: 40GB
RAM: 1024MB

For Python-MySQL connectivity, following data have


been used:-
Host- localhost, user- root, password- root, database- school
Bibliography

[Link]
httas://[Link]
m BOOK — Python by Sumita
Arora

You might also like