https://github.com/inesiscosta/carpark
A Parking Lot Management System written in C for my Introduction to Algorithms and Data Structures class.
https://github.com/inesiscosta/carpark
algorithms-and-data-structures c
Last synced: 9 months ago
JSON representation
A Parking Lot Management System written in C for my Introduction to Algorithms and Data Structures class.
- Host: GitHub
- URL: https://github.com/inesiscosta/carpark
- Owner: inesiscosta
- Archived: true
- Created: 2024-05-15T13:02:33.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-30T17:28:42.000Z (over 1 year ago)
- Last Synced: 2025-01-24T11:15:39.888Z (over 1 year ago)
- Topics: algorithms-and-data-structures, c
- Language: C
- Homepage:
- Size: 10.9 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Parking Lot Management System
This was a project for my Introduction to Algorithms and Data Structures class. It is a program written in C to manage car parks allowing a user to register different parks and log vehicle entrys and exits as well as the fare they need to pay for the time they stayed in the park. enunciado.md contains the instructions provided by the teacher.
## Installation
To set up the build environment run the following commands in your repository's root directory.
1. **Install build dependencies:**
```sh
sudo apt-get update && sudo apt-get install -y build-essential
```
2. **Build the project with GCC:**
```sh
gcc -O3 -Wall -Wextra -Werror -Wno-unused-result -o parkingsystem *.c
```
### Usage
To use the Parking Lot Management System, run the compiled program:
```bash
./parkingsystem
```
Below are the commands you can use with the Parking Management System:
1. **Terminate the Program / Quit (`q`):**
- **Input:** `q`
- **Output:** None
2. **Create or List Parking Lots (`p`):**
- **Input:** `p `
- **Output without arguments:** ` `
- **Output with arguments:** None
- **Errors:**
- `parking already exists.` if the parking lot name already exists.
- `invalid capacity.` if the capacity is ≤ 0.
- `invalid cost.` if any cost is ≤ 0 or costs are not increasing.
- `too many parks.` if the maximum number of parks is reached.
3. **Register Vehicle Entry (`e`):**
- **Input:** `e
4. **Register Vehicle Exit (`s`):**
- **Input:** `s
5. **List Vehicle Entries and Exits (`v`):**
- **Input:** `v `
- **Output:** ` `
- **Errors:**
- `invalid licence plate.` if the license plate is invalid.
- `no entries found in any parking.` if there are no recorded entries for the license plate.
6. **Show Parking Lot Billing (`f`):**
- **Input:** `f []`
- **Output with one argument:** ` `
- **Output with two arguments:** ` `
- **Errors:**
- `no such parking.` if the parking lot does not exist.
- `invalid date.` if the date is invalid or after the last recorded entry/exit.
7. **Remove Parking Lot (`r`):**
- **Input:** `r `
- **Output:** ``
- **Errors:**
- `no such parking.` if the parking lot does not exist.
## Credits:
The tests and respective makefiles were provided by the teacher.
All rights reserved to Pedro Reis @ IST
Copyright (C) 2021, Pedro Reis dos Santos