Skip to content

AbhijithKonnayil/Parking-Lot-Challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Parking Lot Challenge

Description:

Create a parking lot class that takes in a square footage size as input and creates an array of empty values based on the input square footage size. Assume every parking spot is 8x12 (96 ft2) for this program, but have the algorithm that calculates the array size be able to account for different parking spot sizes. For example, a parking lot of size 2000ft2 can fit 20 cars, but if the parking spots were 10x12 (120 ft2), it could only fit 16 cars. The size of the array will determine how many cars can fit in the parking lot.

Create a car class that takes in a 7 digit license plate and sets it as a property. The car will have 2 methods:

  1. A magic method to output the license plate when converting the class instance to a string.

  2. A "park" method that will take a parking lot and spot # as input and fill in the selected spot in the parking lot. If another car is parked in that spot, return a status indicating the car was not parked successfully. If no car is parked in that spot, return a status indicating the car was successfully parked.

Have a main method take an array of cars with random license plates and have them park in a random spot in the parking lot array until the input array is empty or the parking lot is full. If a car tries to park in an occupied spot, have it try to park in a different spot instead until it successfully parks. Once the parking lot is full, exit the program.

Output when a car does or does not park successfully to the terminal (Ex. "Car with license plate [LICENSE_PLATE] parked successfully in spot [SPOT #]").

OPTIONAL/BONUS - Create a method for the parking lot class that maps vehicles to parked spots in a JSON object. Call this method at the end of the program, save the object to a file, and upload the file to an input S3 bucket.

Setup

  1. Clone this repository and run python3 -m venv env in your terminal to create a virtual environment for our project and Activate the virtual environment.
  2. Install the project's dependencies using the provided requirements.txt file:

pip install -r requirements.txt

[Optional] 3. Configure AWS

3.1 Configure AWS Cli as per docs

[https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html]

3.2 After installing, open a terminal and run:

aws configure

3.3 You'll be prompted to enter your AWS Access Key ID, Secret Access Key, default region, and output format. Follow the prompts to complete the configuration.

3.4 run the main.py file

3.5 You can change the parking lot properties like area and parking slot size in the ParkingLot object creation

ParkingLot(area=2000,parking_slot_area=96)

About

Parking lot challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages