Jugando con un Parking realizado como prueba de examen en JetBrains Academy, curso Kotlin Developer

Overview

Kotlin Parking Lot

Proyecto de evaluación para el título de Kotlin Developer en Jetbrains Academy. Consiste en realizar un parking con las especificaciones

Kotlin LISENCE GitHub

imagen

Acerca de

Este proyecto de la academia Jetbrains fue realizado con el fin de evaluar la capacidad de desarrollo de Kotlin. Consiste en jugar con un Parking

Enunciado

Parte 1

Description

Parking lots are an urban necessity. They provide places for you to leave your car without having to worry about it being stolen or towed. Modern car parking systems are automated and are capable of self-management. In this project, you will create a similar system, but in a simplified form.

Let's start by writing a program that can place your car in a parking lot and free the lot when the car leaves. This will be the "skeleton" of our functional parking lot, and we’ll add on to it in the following steps. At busy times, the parking lot may run out of vacant spaces. The program will provide us with aggregated information about the current state of the lot.

Parte 2

Description

At this stage, our minimalistic parking lot has two parking spots. Let's assume that the first spot is occupied and the second one is free.

The parking lot should allow the user to park the car. This is implemented using the park command. After the user has entered this command, the registration number and the color of the car should be specified. For example, park KA-01-HH-1234 Blue. The registration number should not contain spaces. The color can be written in either uppercase and lowercase letters.

As the first spot is already taken, the program should allocate the second spot and print: Blue car parked in spot 2. The color should match what the user inputs.

To pick up the car, the user should print the command leave and then the number of the parking spot, for example, leave 1. If there is no car in the given spot, the program should print an error: There is no car in spot 1. Otherwise, it should notify the user that the spot is now available: Spot 1 is free.

Parte 3

Description

Two spots are not enough for a parking lot, so let's increase the number of parking spaces. We'll jump straight to 20 spaces, numbered from 1 to 20. Initially, all the spots are vacant.

When the user wants to park the car, the program should find an available parking spot with the lowest number.

The user can write commands park and leave repeatedly and type exit to end the program.

If the parking lot is full and there's no room, the program should type Sorry, the parking lot is full..

If there are several available spots for a car, the program should always assign the spot with the lowest number.

Parte 4

Description

In real life, parking lots vary in size. At this stage, we will get better at making art imitate life. To do this, we will make our program customizable by adding a create command that allows the user to specify the number of spots. For example, the command create 3 makes a parking lot with three spots. The number of spots should be positive. The program output should be the following: Created a parking lot with 3 spots.

Other commands like park or leave should return an error Sorry, a parking lot has not been created. until the user enters the create command. If the user calls create again, the previous parking state should be reset.

It is also important to keep track of which spaces are occupied by which cars. For this, add a status command that prints all occupied spots in ascending order. For each spot, it should print the spot number, the car’s plate registration number, and the color of the car, all separated by spaces like the example below. If there are no occupied spots, the program should print: Parking lot is empty.

Parte 5

Description

The command reg_by_color prints all registration numbers of cars of a particular color, taking color as a parameter. The color may be written in uppercase or lowercase letters. For example, reg_by_color BLACK. The answer should contain registration numbers separated by commas. The order should be the same as in the status command. If there are no cars of this color, the output should be like this: No cars with color BLACK were found..

The command spot_by_color is similar to the previous one, but it prints the parking space numbers of all the cars of a particular color.

The command spot_by_reg returns you the number of the spot where a car is located based on its registration number, for example, spot_by_reg KA-01. This command will also return an error message if your car was not found: No cars with registration number KA-01 were found. For convenience, let's suppose that all car registration numbers are unique.

Autor

Codificado con 💖 por José Luis González Sánchez

Twitter GitHub

Contacto

Cualquier cosa que necesites házmelo saber por si puedo ayudarte 💬 .

        

Licencia

Este proyecto está licenciado bajo licencia MIT, si desea saber más, visite el fichero LICENSE para su uso docente y educativo.

You might also like...
Curso microservices kotlin micronaut
Curso microservices kotlin micronaut

Arquitetura de Microserviços Instruções Criando rede no docker: docker network create micronaut-net Criando imagem Postgresql no Docker: docker run -

Curso dos fundamentos da linguagem Kotlin disponibilizado pela TreinaWeb

💻 Kotlin Fundamentos 💻 Curso dos fundamentos da linguagem Kotlin disponibilizado pela TreinaWeb Tecnologias Usadas Kotlin Executando Clone o projeto

DogglersApp - Criação de um App para estudo de RecyclerView no Android Studio. Parte do curso Android Basics in Kotlin

Dogglers - Starter Code Starter code for the second independent project for Android Basics in Kotlin. Introduction This is the starter code for the Do

Repositorio com a finalidade de por em pratica todo o conhecimento das aulas do curso Kotlin e Spring do Zero ao avançado da udemy

kotlin-spring Repositorio com a finalidade de por em pratica todo o conhecimento das aulas do curso Kotlin e Spring do Zero ao avançado da udemy. Obse

Guía de supervivencia de Kotlin para 2º DAM. Curso 2022/2023
Guía de supervivencia de Kotlin para 2º DAM. Curso 2022/2023

Kotlin Supervivencia para 2º DAM Ejemplos de la supervivencia en Kotlin para 2º DAM. Curso 2022/2023. Kotlin Supervivencia para 2º DAM 1. Programación

Kotlin-GraphQL-Apollo - Sencillo cliente para consumir una API GraphQL con Apollo usando Kotlin
Kotlin-GraphQL-Apollo - Sencillo cliente para consumir una API GraphQL con Apollo usando Kotlin

Kotlin GraphQL Apollo Sencillo cliente para consumir una API GraphQL con Apollo

O projeto Calling-Therapies é um aplicativo em desenvolvimento para o Trabalho de Conclusão de Curso da faculdade.

Calling-Therapies 📔 Informações sobre o projeto O projeto Calling-Therapies é um aplicativo em desenvolvimento para o Trabalho de Conclusão de Curso

Repositorio para el curso de Desarrollo Móvil 2021-15
Repositorio para el curso de Desarrollo Móvil 2021-15

Repositorio para el curso de Desarrollo Móvil 2021-15 Construir e instalar la aplicación Vinilos de forma local Clonar el repositorio Puede clonarlo a

Programación - 02 Programación Estructurada y Modular. 1DAM. Curso 2022-2023
Programación - 02 Programación Estructurada y Modular. 1DAM. Curso 2022-2023

Programación - 02 Programación Estructurada y Modular Tema 02 Programación Estructurada y Modular. 1DAM. Curso 2022/2023. Programación - 02 Programaci

Owner
José Luis González Sánchez
Dr. en Informática (PhD). Profe de Secundaria en DAM/DAW/ASIR. Soy GitHub Campus Advisor y Embajador de GitKraken. Tenis, rock, guitarra y buenos momentos.
José Luis González Sánchez
Ejemplo de cómo trabajar con DataFrames similar a Pandas (python) en Kotlin.

Kotlin DataFrames Pandas Ejemplo de cómo trabajar con DataFrames similar a Pandas (python) en Kotlin. Kotlin DataFrames Pandas Acerca de Autor Contact

José Luis González Sánchez 2 Jul 24, 2022
Ejemplo de cómo trabajar con gráficos en Kotlin

Kotlin Let's Plot Ejemplo de cómo trabajar con gráficos en Kotlin. Kotlin Let's Plot Acerca de Autor Contacto ¿Un café? Licencia de uso Acerca de Este

José Luis González Sánchez 12 Oct 11, 2022
Este es un ejemplo de como usar Kotlin en un proyecto Node.js, una api rest en Node.js con Express

Kotlin Hello Node.js Este es un ejemplo de como usar Kotlin en un proyecto Node.js, una API REST con Express Kotlin Hello Node.js Acerca de Uso Compil

José Luis González Sánchez 4 Jul 16, 2022
My nineteenth Kotlin project from JetBrains Academy

Connect Four Stage 5 of 5 for JetBrains Academy - Kotlin - Connect Four project. This stage has us add the option for more than one game ( and keeping

Danny 1 Oct 10, 2021
Prueba técnica solicitada por Grupo Salinas

AppDePeliculas Prueba técnica solicitada por Grupo Salinas Faltó por implementar dos cosas: 1) Soporte local para la pantalla detalles (la pantalla pr

null 1 Mar 20, 2022
Ejemplo de una prueba técnica Junior aplicable a cualquier lenguaje

Prueba Técnica Cola Prioridad Sin Repetidos Ejemplo de una prueba técnica Junior aplicable a cualquier lenguaje. Prueba Técnica Cola Prioridad Sin Rep

José Luis González Sánchez 11 Sep 22, 2022
Parking APP on Kotlin lang

Parksharing Parking APP on Kotlin lang Parksharing is a smarter way to park. Easily pay for street, lot, or garage parking right from your mobile devi

Tigran 2 Dec 11, 2021
The app i wrote in DEVFEST Çanakkale 2021 - Bugdroid Academy while teaching about kotlin and android.

DiceRollerApp An app that rolls dice when the button is clicked. Made this app in DEVFEST Çanakkale 2021 Bugdroid Academy while teaching about kotlin

Beratcan Güreş 0 Nov 29, 2021
Ejemplos de cómo aplicar Inyección de Dependencias en Kotlin

Kotlin Inyección de Dependencias Ejemplos Ejemplos de cómo aplicar Inyección de Dependencias en Kotlin Kotlin Inyección de Dependencias Ejemplos Acerc

José Luis González Sánchez 15 Nov 14, 2022
Exemplo de microsserviço em koltin e spring boot usando a arquitetura hexagonal/ports&adapters como base de estrutura

Microservice boilerplate Exemplo de microsserviço em koltin e spring boot usando a arquitetura hexagonal como base de estrutura Executando Localmente

Odilio 6 Dec 7, 2022