https://github.com/ayvero/java_oop_person
Java OOP exercise to model a Person class with attributes like name, age, BMI calculation, and methods for voting, maturity, and health checks.
https://github.com/ayvero/java_oop_person
java oop-principles oops-in-java
Last synced: 5 months ago
JSON representation
Java OOP exercise to model a Person class with attributes like name, age, BMI calculation, and methods for voting, maturity, and health checks.
- Host: GitHub
- URL: https://github.com/ayvero/java_oop_person
- Owner: Ayvero
- Created: 2023-08-19T01:04:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-25T22:18:00.000Z (7 months ago)
- Last Synced: 2025-03-25T23:25:08.094Z (7 months ago)
- Topics: java, oop-principles, oops-in-java
- Language: Java
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ejercicio de POO - Persona
## Consigna
Implementar una clase llamada **Persona** con las siguientes características:
### Atributos:
- **Nombre**
- **Edad**
- **Fecha de nacimiento**
- **DNI**
- **Sexo**
- **Peso**
- **Altura**### Valores por defecto:
- El **DNI** es un valor obligatorio, no tiene valor por defecto.
- **Fecha de nacimiento** será el 1 de enero de 2000.
- **Sexo** será **Femenino** por defecto.
- El **nombre** por defecto es "N" y el **apellido** es "N".
- El **peso** y la **altura** son 1 por defecto.### Constructores:
Se deben crear los siguientes constructores:
- Constructor con **DNI**.
- Constructor con **DNI, nombre y apellido**.
- Constructor con **DNI, nombre, apellido y fecha de nacimiento**.### Responsabilidades de la clase:
1. **Cálculo del índice de masa corporal (IMC)**: La persona debe ser capaz de calcular su índice de masa corporal, el cual es:
```markdown
IMC = peso / altura^2
------------------------------------------------------------------------------------------------------------------------------
# OOP Exercise - Person## Problem Description
Implement a class called **Person** with the following characteristics:
### Attributes:
- **Name**
- **Age**
- **Date of birth**
- **DNI**
- **Sex**
- **Weight**
- **Height**### Default Values:
- **DNI** is a mandatory value, with no default value.
- **Date of birth** will be set to January 1, 2000.
- **Sex** will be **Female** by default.
- **Name** and **Surname** will be set to "N" by default.
- **Weight** and **Height** will both be set to 1 by default.### Constructors:
The following constructors should be created:
- Constructor with **DNI**.
- Constructor with **DNI, name, and surname**.
- Constructor with **DNI, name, surname, and date of birth**.### Class Responsibilities:
1. **Body Mass Index (BMI) Calculation**: The person should be able to calculate their body mass index, which is:
```markdown
BMI = weight / height^2