Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 25

<< Parking Management System >>

21CSS101J – PROGRAMMING FOR PROBLEM-SOLVING

Mini Project Report

Submitted by

Student Name: MOHANAKRISHNAN VENKATARAMAN


[Reg. No.: RA2311026010403]
B.Tech. CSE - <<AI&ML>>
Student Name: NETHAJI S
[Reg. No.: RA2311026010417]
B.Tech. CSE - <<AL&ML>>

SCHOOL OF COMPUTING
COLLEGE OF ENGINEERING AND TECHNOLOGY
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
(Under Section 3 of UGC Act, 1956)
S.R.M. NAGAR, KATTANKULATHUR – 603 203
CHENGALPATTU DISTRICT

1|Page
November 2023

BONAFIDE CERTIFICATE

Certified that Mini project report titled ________________________________________________ is the


bonafide work of Reg.No___________________________________Name___________________who
carried out the minor project under my supervision. Certified further, that to the best of my knowledge,
the work reported herein does not form any other project report or dissertation on the basis of which a
degree or award was conferred on an earlier occasion on this or any other candidate.

SIGNATURE SIGNATURE

(GUIDE) (HEAD OF THE DEPARTMENT)

2|Page
TABLE OF CONTENTS

S
Title Page No.
No.

1 Problem Statement
Methodology / Procedure/
2
Algorithm
3 Flowchart

4 Coding (C/Python)

5 Modules of the proposed work

6 Results/Screenshots

7 Conclusion

8 References

Problem Statement
3|Page
Objective: The objective of this project is to develop a Parking Management System
that efficiently manages and tracks the parking spaces, transactions, and related
information in a parking facility. The system should provide a user-friendly interface
for both administrators and users, addressing the challenges associated with parking
in urban areas.

Features:

1. User Authentication:
o Implement a secure login system to ensure that only authorized users
can access and operate the Parking Management System.
2. Parking Types and Pricing:
o Support various types of parking spaces (e.g., Two-wheeler, Car, Bus)
with associated pricing.
o Allow administrators to add, modify, or delete parking types and their
corresponding prices.
3. Parking Slots:
o Manage and display the availability status of parking slots (Open/Full).
o Allow administrators to add new parking slots and update their status.
o Ensure that parking slots are associated with specific parking types.
4. Vehicle Entry and Exit:
o Enable users to log their vehicles into the system upon entering the
parking facility.
o Record the entry date and time, vehicle details, and assigned parking
slot.
o Calculate parking fees based on the duration of stay.
o Allow users to log their vehicles out of the parking facility, updating the
exit date and time.

5. Transaction Recording:

4|Page
o Maintain a transaction log that captures details of each vehicle's parking
duration, fees, and related information.
o Ensure that the transaction log is updated in real-time when vehicles
enter or exit the parking facility.
6. Search Functionality:
o Implement a search menu allowing users to search for specific parking
records based on criteria such as Parking ID, Vehicle Number, or Status.
o Provide detailed information about the parking records matching the
search criteria.
7. Reporting:
o Generate reports on various aspects of the parking facility, including:
 Parking types and their prices.
 Free and occupied parking spaces.
 Currently parked vehicles.
 Total amount collected during specific periods.
8. User Interface:
o Design an intuitive and user-friendly interface for ease of navigation.
o Display informative messages and prompts to guide users through the
system.
9. Security Measures:
o Implement security measures to protect user data and system integrity.
o Ensure secure storage and retrieval of sensitive information, such as user
credentials.
10.Developer Information:
o Include details about the developer, such as name, roll number, college
name, and session, for proper attribution.

Conclusion: The Parking Management System aims to streamline the parking


process, enhance user experience, and provide administrators with valuable insights
into parking facility operations. The system should be robust, secure, and capable of
accommodating future enhancements based on user feedback and evolving
requirements.

5|Page
Methodology / Procedure/ Algorithm

1.Define Requirements:
Identify and document the requirements of the Parking Management System. This
includes functionalities such as adding new parking types, managing parking slots,
logging vehicles, calculating fees, generating reports, etc.

2.Database Design:
Design the database schema to store relevant information. Common tables include
parking_type for types of parking spaces, parking_space for individual parking slots,
login for user authentication, and transaction for logging vehicle entries and exits.

3.Database Connectivity:
Establish a connection to the database using a database connector library (e.g.,
mysql.connector in this case). Create a cursor object for executing SQL queries.

4.User Interface Design:


Design the user interface considering the functionalities identified in the
requirements. This may involve command-line interfaces, graphical interfaces (using
libraries like Tkinter), or web interfaces (using frameworks like Flask or Django).

5.Implement Clear Screen Function:


Implement a function to clear the screen for a cleaner user interface. This can be
achieved by printing newline characters.

6.Introduction Display:
Create a function to display an introduction message about the Parking Management
System. This can include information about the problem it solves and basic instructions
for users.

6|Page
7.User Authentication:
Implement a user authentication mechanism to ensure that only authorized users can
access and operate the system. This may involve checking user credentials against a
database.

8.Functionality Implementation:
Implement functions for various functionalities such as adding new parking types,
adding parking slots, modifying parking records, logging vehicles in and out, searching
for parking records, and generating reports.

9.Data Validation:
Validate user inputs to ensure they adhere to expected formats and constraints. This is
crucial for maintaining data integrity in the database.

10.Error Handling:
Implement error-handling mechanisms to gracefully handle unexpected situations,
such as database connection issues, input validation failures, or SQL query errors.

11.Testing:
Test each functionality thoroughly to identify and fix any bugs or issues. Consider unit
testing for individual functions and integration testing for the entire system.

12.Documentation:
Document the code, providing comments and explanations for complex parts. Include
user documentation explaining how to use the system.

13.Optimization and Performance:


Optimize the code for performance, especially when dealing with database interactions.
Consider indexing database fields for faster query execution.

7|Page
Flow Chart

8|Page
Coding (C/Python)

import mysql.connector
import time
from datetime import date

global conn,cursor
conn = mysql.connector.connect(
host='localhost', database=' parking_system', user='root', password='rootpassword')
cursor = conn.cursor()

def clear():
for _ in range(65):
print()

def introduction():
msg = '''
PARKING MANAGEMENT S Y S T E M

- An Introduction

Parking is a very big problem in the matro cities, Day by day basis parking system are coming
up with new technologoes to
solve this issue.

This project is also trying to solve this simple but very useful information for the parking
management. The whole
database is store in MySQL table ParkingSystem that stores their parking slot information as
well as how long a vehicle is parked in thier
parking area and how much he/she need to pay for that.

Besides all these features it also track the total money collected during the period of time with its
extensive searching and reporting
system

The whole project is divided into four major parts ie addition of data, modification, searching
and

9|Page
reporting. all these part are further divided into menus for easy navigation

NOTE: Python is case-SENSITIVE so type exact Column Name wherever required.

If you have any query or suggestions please contact me at Nethaji@123\n\n\n\n'''


for x in msg:
print(x, end='')
time.sleep(0.002)
wait = input('Press any key to continue.....')

def made_by():
msg = '''
Parking Management system made by : Nethaji
Roll No : RA2311026010417
Coll Name : srm
session : 2020-21

Thanks for evaluating my Project.


\n\n\n
'''

for x in msg:
print(x, end='')
time.sleep(0.002)

wait = input('Press any key to continue.....')

def display_parking_type_records():
cursor.execute('select * from parking_type;')
records = cursor.fetchall()
for row in records:
print(row)

def login():
while True:
clear()
uname = input('Enter your id :')
upass = input('Enter your Password :')
cursor.execute('select * from login where name="{}" and pwd ="{}"'.format(uname,upass))
cursor.fetchall()
rows = cursor.rowcount
if rows!=1:

10 | P a g e
print('Invalid Login details..... Try again')
else:
print('You are eligible for operating this system............')
print('\n\n\n')
print('Press any key to continue...............')
break

def add_parking_type_record():
clear()
name = input('Enter Parking Type( 1. Two wheelar 2. Car 3. Bus 4. Truck 5. Trolly ) : ')
price = input('Enter Parking Price per day : ')
sql = 'insert into parking_type(name,price) values("{}",{});'.format(name,price)
cursor.execute(sql)
print('\n\n New Parking Type added....')
cursor.execute('select max(id) from parking_type')
no = cursor.fetchone()
print(' New Parking Type ID is : {} \n\n\n'.format(no[0]))
wait= input('\n\n\nPress any key to continue............')

def add_parking_slot_record():
clear()
parking_type_id = input(
'Enter Parking Type( 1. Two wheelar 2. Car 3. Bus 4. Truck 5. Trolly ) :')
status = input('Enter current Status ( Open/Full ) :')
sql = 'insert into parking_space(typeid,status) values \
("{}","{}");'.format(parking_type_id,status)
cursor.execute(sql)
print('\n\n New Parking Space Record added....')

cursor.execute('select max(id) from parking_space;')


no = cursor.fetchone()
print(' Your Parking ID is : {} \n\n\n'.format(no[0]))
display_parking_type_records()
wait = input('\n\n\nPress any key to continue............')

def modify_parking_type_record():
clear()
print(' M O D I F Y P A R K I N G T Y P E S C R E E N ')
print('-'*100)
print('1. Parking Type Name \n')

11 | P a g e
print('2. Parking Price \n')
choice = int(input('Enter your choice :'))
field=''
if choice==1:
field='name'
if choice==2:
field='price'

park_id = input('Enter Parking Type ID :')


value = input('Enter new values :')
sql = 'update parking_type set '+ field +' = "' + value +'" where id ='+ park_id +';'
cursor.execute(sql)
print('Record updated successfully................')
display_parking_type_records()
wait = input('\n\n\nPress any key to continue............')

def modify_parking_space_record():
clear()
print(' M O D I F Y P A R K I N G S P A C E R E C O R D ')
print('-'*100)
print('1. Parking Type ID(1-Two Wheelar, 2: Car 3.Bus etc ): ')
print('2. status \n')
choice = int(input('Enter your choice :'))
field = ''
if choice == 1:
field = 'type_id'
if choice ==2:
field = 'status'
print('\n\n\n')
crime_id = input('Enter Parking Space ID :')
value = input('Enter new values :')
sql = 'update parking_space set ' + field + \
' = "' + value + '" where id =' + crime_id + ';'
cursor.execute(sql)
print('Record updated successfully................')
wait = input('\n\n\nPress any key to continue............')

def add_new_vehicle():
clear()
print('Vehicle Login Screen ')

12 | P a g e
print('-'*100)
vehicle_id = input('Enter Vehicle Number :' )
parking_id = input('Enter parking ID :')
entry_date = date.today()
sql = 'insert into transaction(vehicle_id,parking_id,entry_date) values \
("{}","{}","{}");'.format(vehicle_id,parking_id,entry_date)
cursor.execute(sql)
cursor.execute('update parking_space set status ="full" where id ={}'.format(parking_id))
print('\n\n\n Record added successfully.................')
wait= input('\n\n\nPress any key to continue.....')

def remove_vehicle():
clear()
print('Vehicle Logout Screen')
print('-'*100)
vehicle_id = input('Enter vehicle No :')
exit_date = date.today()
sql = 'select parking_id,price,entry_date from transaction tr,parking_space ps, parking_type pt \
where tr.parking_id = ps.id and ps.type_id = pt.id and \
vehicle_id ="'+vehicle_id+'" and exit_date is NULL;'
cursor.execute(sql)
record = cursor.fetchone()
days = (exit_date-record[2]).days
if days ==0:
days = days+1
amount = record[1]*days
clear()
print('Logout Details ')
print('-'*100)
print('Parking ID : {}'.format(record[0]))
print('Vehicle ID : {}'.format(vehicle_id))
print('Parking Date : {}'.format(record[2]))
print('Current Date : {}'.format(exit_date))
print('Amount Payable : {}'.format(amount))
wait = input('press any key to continue......')
# update transaction and parking space tables
sql1 = 'update transaction set exit_date ="{}" , amount ={} where vehicle_id ="{}" \
and exit_date is NULL;'.format(exit_date,amount, vehicle_id)
sql2 = 'update parking_space set status ="open" where id = {}'.format(record[0])
cursor.execute(sql1)
cursor.execute(sql2)
wait = input('Vehicle Out from our System Successfully.......\n Press any key to continue....')

13 | P a g e
def search_menu():
clear()
print(' S E A R C H P A R K I N G M E N U ')
print('1. Parking ID \n')
print('2. Vehicle Parked \n')
print('3. Free Space \n')
choice = int(input('Enter your choice :'))
field = ''
if choice == 1:
field = 'id'
if choice == 2:
field = 'vehicle No'
if choice == 3:
field = 'status'
value = input('Enter value to search :')
if choice == 1 or choice==3:
sql = 'select ps.id,name,price, status \
from parking_space ps , parking_type pt where ps.id = pt.id AND ps.id ={}'.format(value)
else:
sql = 'select id,vehicle_id,parking_id,entry_date from transaction where exit_date is NULL;'

cursor.execute(sql)
results = cursor.fetchall()
records = cursor.rowcount
for row in results:
print(row)
if records < 1:
print('Record not found \n\n\n ')
wait = input('\n\n\nPress any key to continue......')

def parking_status(status):
clear()
print('Parking Status :',status)
print('-'*100)
sql ="select * from parking_space where status ='{}'".format(status)
cursor.execute(sql)
records = cursor.fetchall()
for row in records:
print(row)
wait =input('\n\n\nPress any key to continue.....')

14 | P a g e
def vehicle_status_report():
clear()
print('Vehicle Status - Currently Parked')
print('-'*100)
sql='select * from transaction where exit_date is NULL;'
cursor.execute(sql)
records = cursor.fetchall()
for row in records:
print(row)
wait =input('\n\n\nPress any key to continue.....')

def money_collected():
clear()
start_date = input('Enter start Date(yyyy-mm-dd): ')
end_date = input('Enter End Date(yyyy-mm-dd): ')
sql = "select sum(amount) from transaction where \
entry_date ='{}' and exit_date ='{}'".format(start_date,end_date)
cursor.execute(sql)
result = cursor.fetchone()
clear()
print('Total money Collected from {} to {}'.format(start_date,end_date))
print('-'*100)
print(result[0])
wait =input('\n\n\nPress any key to continue.....')

def report_menu():
while True:
clear()
print(' P A R K I N G R E P O R T S ')
print('-'*100)
print('1. Parking Types \n')
print('2. Free Space \n')
print('3. Ocupied Space \n')
print('4. Vehicle Status \n')
print('5. Money Collected \n')
print('6. Exit \n')
choice = int(input('Enter your choice :'))
field = ''
if choice == 1:
display_parking_type_records()
if choice == 2:

15 | P a g e
parking_status("open")
if choice == 3:
parking_status("full")
if choice == 4:
vehicle_status_report()
if choice == 5:
money_collected()
if choice ==6:
break

def main_menu():
clear()
login()
clear()
introduction()

while True:
clear()
print(' P A R K I N G M A N A G E M E N T S Y S T E M')
print('*'*100)
print("\n1. Add New Parking Type")
print("\n2. Add New Parking Slot")
print('\n3. Modify Parking Type Record')
print('\n4. Modify Parking Slot Record')
print('\n5. Vehicle Login ')
print('\n6. Vehicle Logout')
print('\n7. Search menu')
print('\n8. Report menu')
print('\n9. Close application')
print('\n\n')
choice = int(input('Enter your choice ...: '))

if choice == 1:
add_parking_type_record()

if choice == 2:
add_parking_slot_record()

if choice == 3:
modify_parking_type_record()

16 | P a g e
if choice == 4:
modify_parking_space_record()

if choice == 5:
add_new_vehicle()

if choice == 6:
remove_vehicle()

if choice == 7:
search_menu()

if choice == 8:
report_menu()

if choice == 9:
break
made_by()

if _name_ == "_main_":
main_menu()

17 | P a g e
Modules of the proposed work

The code you provided is a Python program that creates a basic scientific calculator
application using the Tkinter library for the graphical user interface. Here's a breakdown of
the modules and components used in this code:

1. Tkinter: This is the primary module used to create the GUI for the calculator.
2. math: The math module is used to perform various mathematical operations, such
as square root, trigonometric functions, logarithms, and more.
3. tkinter.messagebox: This module is used for displaying message boxes, such as
asking the user if they want to exit the application.

Now, let's break down the code's structure:

 The main application window is created using the Tk() constructor.


 The Calc class is defined to handle calculator operations and keep track of its state,
including the current value, total, and selected operation.
 The numberEnter method allows the user to input numbers and handles decimal
input.
 The sum_of_total method is used to calculate the result when the equals (=) button
is pressed.
 Various other methods, such as display, valid_function, and math functions (e.g.,
cos, sin, log, etc.), are used to perform different operations on the calculator.
 Buttons and Entry widgets are created for the calculator interface. Buttons for digits
0-9, arithmetic operations (+, -, *, /), clear buttons, and various mathematical
functions are included.
 The menubar is created to provide options for switching between standard and
scientific calculator modes, as well as exiting the application.
 The Scientific and Standard functions set the calculator's mode by adjusting its size
and functionality.
 The iExit function is used to ask the user for confirmation before exiting the
application.
 The GUI layout is configured, and the Tkinter event loop (root.mainloop()) is started
to run the application.

This code creates a GUI-based scientific calculator that allows users to perform standard
and scientific calculations and switch between modes. It provides basic mathematical
operations, trigonometric functions, and other scientific features.
18 | P a g e
Results/Screenshots

19 | P a g e
20 | P a g e
21 | P a g e
22 | P a g e
23 | P a g e
Conclusion:
The provided code represents a basic implementation of a Parking Management
System in Python using MySQL for database operations. Here is a summary of the key
features and functionalities:

Database Connection:
Utilizes the mysql.connector library to establish a connection with a MySQL database.
User Interface:
Incorporates a simple command-line interface for user interaction.
Presents an introduction to the Parking Management System upon startup.
Includes a login system to verify user credentials before accessing the system.
Functionality Modules:
Parking Management:
Allows the addition of new parking types and slots.
Supports modification of parking type and slot records.
Transaction Management:
Facilitates vehicle login and logout transactions.
Calculates and displays amount payable for parked vehicles.
Search Functionality:
Provides a search menu with options to search for parking by ID, vehicle number, or
free space.
Reporting System:
Generates reports on parking types, free and occupied spaces, currently parked
vehicles, and money collected within a specified date range.
Structured Modularity:
Organizes code into separate modules for better maintainability and readability.
Divides functionalities into functions and methods within respective modules.
User Interaction Loop:
Presents a main menu to the user, allowing them to choose various operations.
Loops until the user decides to close the application.
Conclusion Screen:
Displays a closing screen with information about the creator of the system.
Note:
Reminds users that Python is case-sensitive and to type exact column names when
required.
24 | P a g e
References
 https://www.geeksforgeeks.org
 Youtube
 Faculty
 Working Professional

25 | P a g e

You might also like