Created
April 23, 2020 11:38
-
-
Save olegrewko/3b8d59ddd354d1c80e928cf3782a15f1 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 IgorDolgov; | |
import java.util.Scanner; | |
public class IndexMassBody { | |
static float roost, ves, index; | |
static String s; | |
public static void main (String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
System.out.println("Введите свой рост в метрах(00,0) и вес в килограммах(000,0) через пробел"); | |
float roost = scanner.nextFloat(); | |
float ves = scanner.nextFloat(); | |
index = ves / (roost * roost); | |
if (index < 16) s = "Дефицит массы"; | |
else if (index >= 16 && index < 20) s = "Недостаточный вес"; | |
else if (index >= 20 && index < 25) s = "Норма"; | |
else if (index >= 25 && index < 30) s = "Предожирение"; | |
else if (index >= 30 && index < 35) s = "Первая степень ожирения"; | |
else if (index >= 35 && index < 40) s = "Вторая степень ожирения"; | |
else s = "Морбидное ожирение"; | |
System.out.println(s); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment