Implementar una clase llamada Persona con las siguientes características:
- Nombre
- Edad
- Fecha de nacimiento
- DNI
- Sexo
- Peso
- Altura
- 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.
Se deben crear los siguientes constructores:
- Constructor con DNI.
- Constructor con DNI, nombre y apellido.
- Constructor con DNI, nombre, apellido y fecha de nacimiento.
- Cálculo del índice de masa corporal (IMC): La persona debe ser capaz de calcular su índice de masa corporal, el cual es:
IMC = peso / altura^2
Implement a class called Person with the following characteristics:
- Name
- Age
- Date of birth
- DNI
- Sex
- Weight
- Height
- 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.
The following constructors should be created:
- Constructor with DNI.
- Constructor with DNI, name, and surname.
- Constructor with DNI, name, surname, and date of birth.
- Body Mass Index (BMI) Calculation: The person should be able to calculate their body mass index, which is:
BMI = weight / height^2