Last active
August 29, 2015 13:56
-
-
Save daryo918/8845905 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tarea; | |
public class PesoIdeal { | |
private String nombre; | |
private String apellido; | |
private char sexo; | |
private float estatura; | |
private float peso; | |
public PesoIdeal(String nombre,String apellido,char sexo,float estatura,float peso) | |
{ | |
this.nombre=nombre; | |
this.apellido=apellido; | |
this.sexo=sexo; | |
this.estatura=estatura; | |
this.peso=peso; | |
} | |
public String getNombre() { | |
return nombre; | |
} | |
public void setNombre(String nombre) { | |
this.nombre = nombre; | |
} | |
public String getApellido() { | |
return apellido; | |
} | |
public void setApellido(String apellido) { | |
this.apellido = apellido; | |
} | |
public char getSexo() { | |
return sexo; | |
} | |
public void setSexo(char sexo) { | |
this.sexo = sexo; | |
} | |
public float getEstatura() { | |
return estatura; | |
} | |
public void setEstatura(float estatura) { | |
this.estatura = estatura; | |
} | |
public float getPeso() { | |
return peso; | |
} | |
public void setPeso(float peso) { | |
this.peso = peso; | |
} | |
public float calcularIMC(){ | |
float IMC=(peso/(estatura*estatura)); | |
return IMC; | |
} | |
public float calcularpesoIdeal(){ | |
float imc; | |
if(sexo=='f' || sexo == 'F') | |
{ | |
imc=((estatura*100)-100)-10; | |
} | |
else | |
{ | |
imc=(estatura*100)-100; | |
} | |
return imc; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment