You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
566 B
Java
34 lines
566 B
Java
4 years ago
|
package com.company.bmi;
|
||
4 years ago
|
|
||
|
public class HealthKlasse {
|
||
|
|
||
|
|
||
|
public double bmiRechner(double gewicht, double große){
|
||
|
|
||
|
return (gewicht / Math.pow(große, 2));
|
||
|
|
||
|
}
|
||
|
|
||
|
public String kategorie(double BMI){
|
||
|
|
||
|
String klasse = "";
|
||
|
|
||
|
if(BMI < 18.5){
|
||
|
klasse = "untergewichtig";
|
||
|
}
|
||
|
else if(BMI <= 25){
|
||
|
klasse = "normalgewichtig";
|
||
|
}
|
||
|
else if(BMI <= 30){
|
||
|
klasse = "übergewichtig";
|
||
|
}
|
||
|
else{
|
||
|
klasse = "fettleibig";
|
||
|
}
|
||
|
|
||
|
return klasse;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|