Barco
Este es un proyecto Java que define la clase Barco que extiende la clase Vehiculo.
Si hubiese un método para instalar o ejecutar el proyecto, se indicaría aquí.
La clase Barco representa un vehículo acuático y se utiliza para instanciar objetos que contienen información sobre el color, la marca, el precio, la matrícula y el tipo de barco. La clase también tiene un método para arrancar el barco y establecer la hora de inicio del viaje. Funcionalidades
La clase Barco tiene las siguientes funcionalidades:
Constructor: Crea una instancia de Barco con un color, marca, precio, matrícula y tipo de barco.
getTipoBarco(): Devuelve el tipo de barco.
arrancar(): Arranca el barco y establece la hora de inicio del viaje. Si el barco ya está en marcha, muestra un mensaje de aviso.
retroceder(int metros): Retrocede el barco la cantidad de metros indicada. Si el barco no está en marcha, muestra un mensaje de aviso.
parar(): Para el barco y muestra la hora de inicio y fin del viaje. Si el barco no está en marcha, muestra un mensaje de aviso.
avanzar(int distancia): Avanza el barco la cantidad de metros indicada. Si el barco no está en marcha, muestra un mensaje de aviso.
imprimirDatos(): Muestra los datos del barco.
Barco barco = new Barco("Azul", "Marca", "5000", "1234ABC", "Tipo de Barco");
String tipoBarco = barco.getTipoBarco();
barco.arrancar();TODO: Cómo se debe usar el proyecto.
Uso de la clase Barco
Para utilizar la clase Barco, primero debe instanciar un objeto pasando los argumentos adecuados al constructor. Luego, puede llamar a los métodos getTipoBarco() y arrancar() según sea necesario.
- Fork it!
- Crea tu feature branch:
git checkout -b my-new-feature - Haz Commit de tus cambios:
git commit -am 'Add some feature' - Push al branch:
git push origin my-new-feature - Submit un pull request
- Version 0.1 (2023-04-19) - lanzamiento inicial
- Version 0.2 (2023-04-20) - añadido método avanzar()
- Version 0.3 (2023-04-21) - añadido método retroceder()
- Version 0.4 (2023-04-22) - añadido método parar()
- Version 0.5 (2023-04-23) - añadido resto de métodos
- Version 0.6 (2023-04-24) - Pruebas unitarias y correcciones
Lead Developer - Mentor - Carlos
The MIT License (MIT)
Copyright (c) 2015 Chris Kibble
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.