36 lines
965 B
Java
36 lines
965 B
Java
public class BMI{
|
|
public static void main(String args[]){
|
|
double gewicht = 120;
|
|
double groesse = 1.8;
|
|
|
|
double bmi = gewicht / (groesse * groesse);
|
|
System.out.println("Dein BMI bei einer Größe von " + groesse + "m") ;
|
|
System.out.println("und einem Gewicht von " + gewicht + "kg");
|
|
System.out.println("beträgt " + bmi);
|
|
|
|
if (bmi < 16) {
|
|
System.out.println("Starkes Untergewicht");
|
|
}
|
|
else if(bmi < 17) {
|
|
System.out.println("Mäßiges Untergewicht");
|
|
}
|
|
else if(bmi < 18.5) {
|
|
System.out.println("Leichtes Untergewicht");
|
|
}
|
|
else if (bmi < 25) {
|
|
System.out.println("Normalgewicht");
|
|
}
|
|
else if (bmi < 30) {
|
|
System.out.println("Übergewicht");
|
|
}
|
|
else if (bmi < 35) {
|
|
System.out.println("Adipositas I");
|
|
}
|
|
else if (bmi < 40) {
|
|
System.out.println("Adipositas II");
|
|
}
|
|
else {
|
|
System.out.println("Adipositas III");
|
|
}
|
|
}
|
|
} |