-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalculadoraIMC.java
More file actions
38 lines (24 loc) · 869 Bytes
/
CalculadoraIMC.java
File metadata and controls
38 lines (24 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.util.Scanner;
public class CalculadoraIMC {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Digite seu pedo (kg):");
double peso = sc.nextDouble();
System.out.println("Digite sua altura (m):");
double altura = sc.nextDouble();
sc.close();
double imc = peso / (altura * altura);
System.out.printf("Seu IMC é: %.2f\n", imc);
if (imc < 20) {
System.out.println("Abaixo do peso.");
} else if (imc >= 20 && imc < 25) {
System.out.println("Peso Normal");
} else if (imc < 30) {
System.out.println("Sobrepeso");
} else if (imc < 40) {
System.out.println("Obseo.");
} else {
System.out.println("Obeso mórbido.");
}
}
}