0% found this document useful (0 votes)
9 views7 pages

Parkimg Managment College Project

The document outlines a Parking Management System project developed by a group of students, detailing its functionalities such as parking and removing vehicles, and displaying parking lot status. It includes a structured program with source code that manages vehicle records using a database approach. The main program allows user interaction for managing parking spaces effectively.

Uploaded by

Ramanjeet Kaur
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)
9 views7 pages

Parkimg Managment College Project

The document outlines a Parking Management System project developed by a group of students, detailing its functionalities such as parking and removing vehicles, and displaying parking lot status. It includes a structured program with source code that manages vehicle records using a database approach. The main program allows user interaction for managing parking spaces effectively.

Uploaded by

Ramanjeet Kaur
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/ 7

PARKING

MANAGEMENT
SYSTEM

MADE BY GROUP-
ARSHBIR SINGH
CHHABRA
JASJOT SINGH
CSE (Evening Shift)
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 effectively 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.
Features:

Park a vehicle: Add a vehicle to the parking lot.

Remove a vehicle: Remove a vehicle from the parking lot.

View parking lot status: See the current status of parking spaces
(occupied/free).
Project Structure

1. Main Parking System Class

2. Parking Lot Status Functions

3. Parking and Removing Vehicles


SOURCE CODE
class ParkingLot:

def _init_(self, total_spaces):

self.total_spaces = total_spaces

self.available_spaces = total_spaces

self.parking_slots = {} # Dictionary to store vehicle info in slots

def park_vehicle(self, vehicle_number):

if self.available_spaces > 0:

# Find the lowest available slot number

for slot in range(1, self.total_spaces + 1):

if slot not in self.parking_slots:

slot_number = slot

break

self.parking_slots[slot_number] = vehicle_number

self.available_spaces -= 1

print(f"Vehicle {vehicle_number} parked at slot {slot_number}.")

else:

print("No parking spaces available.")

def remove_vehicle(self, slot_number):

if slot_number in self.parking_slots:

vehicle_number = self.parking_slots.pop(slot_number)

self.available_spaces += 1
print(f"Vehicle {vehicle_number} removed from slot {slot_number}.")

else:

print(f"No vehicle found in slot {slot_number}.")

def display_status(self):

print("\n----- Parking Lot Status -----")

print(f"Total spaces: {self.total_spaces}")

print(f"Available spaces: {self.available_spaces}")

if self.parking_slots:

print("\nOccupied slots:")

print("Slot Number | Vehicle Number")

print("---------------------------")

for slot in sorted(self.parking_slots):

print(f"{str(slot).ljust(11)} | {self.parking_slots[slot]}")

else:

print("No vehicles currently parked.")

print("---------------------------\n")

# Main Program

def main():

while True:

try:

total_spaces = int(input("Enter the total number of parking spaces: "))

if total_spaces <= 0:

print("Total spaces must be a positive integer. Please try again.")

continue

break
except ValueError:

print("Invalid input. Please enter a valid integer for total parking spaces.")

parking_lot = ParkingLot(total_spaces)

while True:

print("\n----- Parking Lot Management -----")

print("1. Park Vehicle")

print("2. Remove Vehicle")

print("3. Display Parking Lot Status")

print("4. Exit")

choice = input("Enter your choice: ").strip()

if choice == '1':

vehicle_number = input("Enter vehicle number: ").strip()

if vehicle_number:

parking_lot.park_vehicle(vehicle_number)

else:

print("Vehicle number cannot be empty.")

elif choice == '2':

try:

slot_number = int(input("Enter slot number to remove vehicle: ").strip())

if 1 <= slot_number <= parking_lot.total_spaces:

parking_lot.remove_vehicle(slot_number)

else:

print(f"Invalid slot number. Please enter a number between 1 and


{parking_lot.total_spaces}.")

except ValueError:
print("Invalid input. Please enter a valid slot number.")

elif choice == '3':

parking_lot.display_status()

elif choice == '4':

print("Exiting the Parking Lot Management System. Goodbye!")

break

else:

print("Invalid choice. Please select a valid option from the menu.")

if _name_ == "_main_":

main()

OUTPUT

You might also like