You are on page 1of 27

University of Mumbai

Project Report on

“Animal rescue website”


Submitted by
Mr. Juned khan(55)
Mr. Talha Khan (56)
Mr. Shadan Shaikh (67)
Mr. Anas Sayyed (64)
Under the Guidance of

Prof. XYZ

Department of Computer Engineering

Theem College of Engineering

Boisar Chilhar Road, Boisar (E),

401501 (2023-24)
“Car Parking Management”
Submitted in partial fulfillment of the requirements of the Degree of

Bachelor of Computer Engineering

By

Mr. Juned khan(55)


Mr. Talha Khan (56)
Mr. Shadan Shaikh (67)
Mr. Anas Sayyed (64)

Under the Guidance of

Prof. XYZ

Department of Computer Engineering

Theem College of Engineering

Boisar-Chilhar Road, Boisar (E), 401501

University of Mumbai

(2023-2024)
DEPARTMENT OF COMPUTER ENGINEERING

THEEM COLLEGE OF ENGINEERING


Boisar-Chilhar Road, Boisar (E), 401501
(Approved By AICTE New Delhi, Government of Maharashtra &
DTE, Affiliated To University of Mumbai & MSBTE)
Awarded ‘B+’ Grade by NAAC

CERTIFICATE

This is to certify that the Project entitled “Car Parking Management” is a bonafide
work of Mr. JUNED KHAN (55), Mr. TALHA KHAN (17), Mr. SHADAN
SHAIKH (67), Mr. ANAS SAYYED submitted to the University of Mumbai in
partial fulfillment of the requirement for the award of the Degree of “Bachelor of
Computer Engineering”.

Prof. XYZ Prof. Monika Samir Pathare


(Project
1 Guide) (Project Co-Ordinator)

Prof. Mubashir Khan Dr. Riyazuddin Siddiqui


(HOD) (Principal)
Mini-Project Report Approval for S.E.

The project entitled “Mr. JUNED KHAN (55), Mr. TALHA KHAN (56), Mr.
SHADAN SHAIKH (67), Mr. ANAS SAYED(64)”is approved for the Degree of
“Bachelor of Computer Engineering.”

Examiners

1.………………………

2.…………………...….

Date:

Place:
DECLARATION

We declare that this written submission represents our ideas in my own words and
where others’ ideas or words have been included, we have adequately cited and
referenced the original sources. We also declare that we have adhered to all principles
of academic honesty and integrity and have not misrepresented or fabricated or
falsified any idea/data/fact/source in my submission. We understand that any violation
of the above will be cause for disciplinary action by the Institute and can also evoke
penal action from the sources which have thus not been properly cited or from whom
proper permission has not been taken when needed.

Mr. JUNED KHAN (55)

Mr. TALHA KHAN (56)

Mr. SHADAN SHAIKH (67)

Mr. ANAS SAYYED (64)

Date:
ACKNOWLEDGEMENT

First and foremost we thank God Almighty for blessing us immensely and
empowering me at times of difficulty like a beacon of light. Without His divine
intervention I wouldn’t have accomplished this project without any hindrance.

We are also grateful to the Management of Theem College of Engineering for their
kind support. Moreover, we thank our beloved Principal Dr. Riyazuddin Siddiqui,
Director, Dr. N.K. Rana for their constant encouragement and valuable advice
throughout the course.

We are profoundly indebted to Prof. Mubashir Khan, Head of the Department,


Computer Engineering & Prof. Mohd. Shakeel (Project Coordinator) for helping
us technically and giving valuable advice and suggestions from time to time. They
are always our source of inspiration.

Also, we would like to take this opportunity to express my profound thanks to our
guide Prof. XYZ, Assistant Professor, Computer Engineering for his/her valuable
advice and whole hearted cooperation without which this project would not have
seen the light of day.

We express our sincere gratitude to all Teaching/Non-Teaching staff members of our


department for their co-operation and support during this project.

Mr. JUNED KHAN (55)

Mr. TALHA KHAN (56)

Mr. SHADAN SHAIKH (67)

Mr. ANAS SAYED (64)

v
ABSTRACT

The Car Parking Management System is a console-based application developed


in Core Java to address the challenges associated with efficient parking space
management. In today's urban environments, where the demand for parking spaces is
constantly increasing, an organized and streamlined approach to parking
management is crucial. This project aims to provide a solution by offering a simple
yet effective system for dynamically managing parking lots.

The purpose of the Car Parking Management System is to facilitate the


efficient allocation and deallocation of parking spots, provide real-time information
about parking spot status, and enhance the overall user experience for both
administrators and drivers. The system supports a dynamically-sized parking lot,
enabling scalability to accommodate parking lots of varying capacities.

Key features of the system include dynamic parking lot management, parking
spot allocation based on availability, real-time display of parking spot status, a user-
friendly console interface, and basic error handling to ensure a smooth user
interaction. The project is designed to optimize the use of available parking space,
provide a streamlined process for drivers, empower administrators with informed
decisions on resource utilization, and contribute to improved traffic flow and reduced
congestion.

The Car Parking Management System demonstrates the application of


fundamental Core Java concepts in an organized and practical manner. Through this
project, users can experience a simplified yet effective solution to the complexities of
parking space management, contributing to enhanced urban mobility and user
convenience.

vi
INDEX

Chapter Number Chapter Name Page Number

01 Car Parking Management 08

02 Interface 09-11

03 Display Parking lot Status 12-13

04 Park Car 14

05 Leave Parking Spot 15-17

06 Exit 18

07 Code 19-24

08 Conclusion 25

vii
Chapter No. 1: Car Parking Management

The Car Parking Management System is a software application developed in Core


Java to tackle the challenges associated with parking space management in urban
environments. With the rising demand for efficient parking solutions, this project
aims to provide a practical and scalable system for dynamically managing parking
lots. The system is designed to optimize parking space utilization, streamline the
allocation and deallocation of parking spots, and enhance the overall user
experience for both administrators and drivers.

Features:

The Car Parking Management System boasts several features that contribute to
its effectiveness and user-friendliness:

Dynamic Parking Lot Management:

The system supports the creation of dynamically-sized parking lots, allowing


for scalability based on varying parking
lot capacities.

Parking Spot Allocation:

Cars can be efficiently parked based on the availability of spots, ensuring


optimal space utilization.

Spot Status Display:

Users, including both administrators and drivers, can view real-time status
updates of parking spots, enabling quick decision-making.

User-Friendly Console Interface:

The application features a console-based interface designed for accessibility,


ensuring ease of use for both novice and experienced users.

Basic Error Handling:

The system incorporates basic error handling mechanisms to provide a smooth


and reliable user interaction experience.

viii
Chapter No. 2: Interface

The project contains an interface which gives users a variety of options which
indirectly displays the functions of the system. The interface contains a set of
options:

1. Add new record


2. Display all records
3. Search for a record
4. Exit

Code:

public class CarParkingManagementApp {

public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);

System.out.print("Enter the capacity of the parking lot: ");

int capacity = scanner.nextInt();

ParkingLot parkingLot = new ParkingLot(capacity);

while (true) {

System.out.println("\nCar Parking Management Menu:");

System.out.println("1. Display Parking Lot Status");

System.out.println("2. Park Car");

System.out.println("3. Leave Parking Spot");

System.out.println("4. Exit");

System.out.print("Enter your choice: ");

int choice = scanner.nextInt();

ix
switch (choice) {

case 1:

parkingLot.displayParkingLot();

break;

case 2:

scanner.nextLine(); // Consume the newline character

System.out.print("Enter car license plate: ");

String licensePlate = scanner.nextLine();

System.out.print("Enter car brand: ");

String brand = scanner.nextLine();

Car newCar = new Car(licensePlate, brand);

parkingLot.parkCar(newCar);

break;

case 3:

System.out.print("Enter spot number to leave: ");

int spotNumber = scanner.nextInt();

Car departingCar = parkingLot.leaveSpot(spotNumber);

if (departingCar != null) {

System.out.println("Car leaving spot: " + departingCar);

break;

x
case 4:

System.out.println("Exiting Car Parking Management. Goodbye!");

System.exit(0);

break;

default:

System.out.println("Invalid choice. Please enter a valid option.");

Console:

xi
Chapter No. 3: Display Parking Lot Status

The displayParkingLot() method is responsible for presenting the current status of


the parking lot. It provides information about each parking spot, indicating
whether the spot is occupied and details about the parked car, if any.

The displayParkingLot() method is significant as it serves as a means for both


administrators and users to visualize the current occupancy status of the parking
lot. It aids in decision-making, helping users identify available spots and
administrators to monitor and manage the parking lot efficiently

Code:

public void displayParkingLot() {

System.out.println("Parking Lot Status:");

for (ParkingSpot spot : spots) {

System.out.println(spot);

public void parkCar(Car car) {

for (ParkingSpot spot : spots) {

if (!spot.isOccupied()) {

spot.parkCar(car);

return;

System.out.println("Parking lot is full. Cannot park the car.");

Console:

xii
xiii
Chapter No. 4: Park car

The parkCar method is a critical component of the system as it enables the


allocation of parking spots to cars. This functionality is fundamental to the overall
goal of the Car Parking Management System, which is to efficiently manage and
utilize parking spaces within the parking lot. The method ensures that cars are
assigned spots based on availability, contributing to an organized and optimized
parking system.

CODE:

public void parkCar(Car car) {

for (ParkingSpot spot : spots) {

if (!spot.isOccupied()) {

spot.parkCar(car);

return;

System.out.println("Parking lot is full. Cannot park the car.");

CONSOLE:

xiv
xv
Chapter No. 5: leave parking spot

The leaveSpot method is responsible for deallocating a parking spot when a car
leaves. It allows a user to specify the spot number from which the car is departing,
and the system marks that spot as vacant.
The leaveSpot method is crucial for maintaining an accurate representation of
parking spot occupancy in the system. By allowing users to specify the spot from
which a car is departing, the method ensures that the parking lot status is updated
accordingly. This functionality contributes to the overall goal of efficiently
managing parking spaces within the parking lot.
CODE:
public Car leaveSpot(int spotNumber) {
if (isValidSpotNumber(spotNumber)) {
ParkingSpot spot = spots.get(spotNumber - 1);
if (spot.isOccupied()) {
return spot.leaveSpot();
} else {
System.out.println("Spot " + spotNumber + " is already empty.");
}
} else {
System.out.println("Invalid spot number.");
}
return null;
}

private boolean isValidSpotNumber(int spotNumber) {


return spotNumber >= 1 && spotNumber <= spots.size();
}
}

public class CarParkingManagementApp {


public static void main(String[] args) {

xvi
Scanner scanner = new Scanner(System.in);
System.out.print("Enter the capacity of the parking lot: ");
int capacity = scanner.nextInt();

ParkingLot parkingLot = new ParkingLot(capacity);

while (true) {
System.out.println("\nCar Parking Management Menu:");
System.out.println("1. Display Parking Lot Status");
System.out.println("2. Park Car");
System.out.println("3. Leave Parking Spot");
System.out.println("4. Exit");
System.out.print("Enter your choice: ");

int choice = scanner.nextInt();

switch (choice) {
case 1:
parkingLot.displayParkingLot();
break;

case 2:
scanner.nextLine(); // Consume the newline character
System.out.print("Enter car license plate: ");
String licensePlate = scanner.nextLine();
System.out.print("Enter car brand: ");
String brand = scanner.nextLine();

Car newCar = new Car(licensePlate, brand);


parkingLot.parkCar(newCar);
break;

xvii
case 3:
System.out.print("Enter spot number to leave: ");
int spotNumber = scanner.nextInt();
Car departingCar = parkingLot.leaveSpot(spotNumber);
if (departingCar != null) {
System.out.println("Car leaving spot: " + departingCar);
}
break;
CONSOLE:

Chapter No. 6: Exit

xviii
The exit functionality allows the user to terminate the program gracefully,
bringing the execution to a halt and returning control to the operating system.
The exit functionality is essential for providing users with a clean and
straightforward way to exit the program. It ensures that resources are released, and
any cleanup operations are performed before the program concludes.

CODE:
case 4:
System.out.println("Exiting Car Parking Management. Goodbye!");
System.exit(0);
break;

default:
System.out.println("Invalid choice. Please enter a valid option.");
}
}
}
}
CONSOLE:

xix
Chapter No. 7: Code

import java.util.ArrayList;
import java.util.Scanner;

class Car {
private String licensePlate;
private String brand;

public Car(String licensePlate, String brand) {


this.licensePlate = licensePlate;
this.brand = brand;
}

public String getLicensePlate() {


return licensePlate;
}

public String getBrand() {


return brand;
}

@Override
public String toString() {
return "License Plate: " + licensePlate + ", Brand: " + brand;
}
}

class ParkingSpot {
private int spotNumber;

xx
private Car parkedCar;

public ParkingSpot(int spotNumber) {


this.spotNumber = spotNumber;
this.parkedCar = null;
}

public boolean isOccupied() {


return parkedCar != null;
}

public void parkCar(Car car) {


parkedCar = car;
System.out.println("Car parked at spot number " + spotNumber);
}

public Car leaveSpot() {


Car departingCar = parkedCar;
parkedCar = null;
return departingCar;
}

public int getSpotNumber() {


return spotNumber;
}

@Override
public String toString() {
if (isOccupied()) {
return "Spot " + spotNumber + ": " + parkedCar;
} else {

xxi
return "Spot " + spotNumber + ": Empty";
}
}
}

class ParkingLot {
private ArrayList<ParkingSpot> spots;

public ParkingLot(int capacity) {


spots = new ArrayList<>(capacity);
for (int i = 1; i <= capacity; i++) {
spots.add(new ParkingSpot(i));
}
}

public void displayParkingLot() {


System.out.println("Parking Lot Status:");
for (ParkingSpot spot : spots) {
System.out.println(spot);
}
}

public void parkCar(Car car) {


for (ParkingSpot spot : spots) {
if (!spot.isOccupied()) {
spot.parkCar(car);
return;
}
}
System.out.println("Parking lot is full. Cannot park the car.");
}

xxii
public Car leaveSpot(int spotNumber) {
if (isValidSpotNumber(spotNumber)) {
ParkingSpot spot = spots.get(spotNumber - 1);
if (spot.isOccupied()) {
return spot.leaveSpot();
} else {
System.out.println("Spot " + spotNumber + " is already empty.");
}
} else {
System.out.println("Invalid spot number.");
}
return null;
}

private boolean isValidSpotNumber(int spotNumber) {


return spotNumber >= 1 && spotNumber <= spots.size();
}
}

public class CarParkingManagementApp {


public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter the capacity of the parking lot: ");
int capacity = scanner.nextInt();

ParkingLot parkingLot = new ParkingLot(capacity);

while (true) {
System.out.println("\nCar Parking Management Menu:");
System.out.println("1. Display Parking Lot Status");

xxiii
System.out.println("2. Park Car");
System.out.println("3. Leave Parking Spot");
System.out.println("4. Exit");
System.out.print("Enter your choice: ");

int choice = scanner.nextInt();

switch (choice) {
case 1:
parkingLot.displayParkingLot();
break;

case 2:
scanner.nextLine(); // Consume the newline character
System.out.print("Enter car license plate: ");
String licensePlate = scanner.nextLine();
System.out.print("Enter car brand: ");
String brand = scanner.nextLine();

Car newCar = new Car(licensePlate, brand);


parkingLot.parkCar(newCar);
break;

case 3:
System.out.print("Enter spot number to leave: ");
int spotNumber = scanner.nextInt();
Car departingCar = parkingLot.leaveSpot(spotNumber);
if (departingCar != null) {
System.out.println("Car leaving spot: " + departingCar);
}
break;

xxiv
case 4:
System.out.println("Exiting Car Parking Management. Goodbye!");
System.exit(0);
break;

default:
System.out.println("Invalid choice. Please enter a valid option.");
}
}
}
}

Chapter No. 8: Conclusion

xxv
The conclusion section serves as the final segment of the program execution,
providing an opportunity to perform cleanup activities, display a farewell
message, and summarize the overall experience of using the Car Parking
Management System.
The conclusion section is significant as it ensures a proper and graceful
termination of the program.
It provides a positive and informative ending to the user, making their experience
with the Car Parking Management System more satisfying.
The conclusion section is the last impression the user has of the program. A well-
crafted conclusion ensures a positive user experience, communicates the
successful execution of the program, and leaves the user with a sense of closure.
 User Experience:
 It ensures a positive and polished user experience by providing a clear and
friendly termination message.
 Resource Management:
 Cleanup operations contribute to proper resource management, closing any
open connections and releasing allocated resources.
 Feedback and Closure:
 The farewell message provides feedback to the user and a sense of closure,
 concluding their interaction with the system.

xxvi

You might also like