import java.util.
Scanner;
public class Main{
public static void main(String[] args)
Scanner ler = new Scanner(System.in);
String nome1;
float peso1, altura1;
float imc1;
String classifica1;
System.out.println("Nome: ");
nome1 = ler.nextLine();
System.out.println("Peso(kg): ");
peso1 = ler.nextFloat();
System.out.println("Altura(m): ");
altura1 = ler.nextFloat();
ler.nextLine();
if(altura1 == 0) {
System.out.println("[ERRO] impossivel efetuar a divisão por 0. Tente
novamente");
imc1 = calcularIMC(peso1,altura1);
classifica1 = resultadoIMC(imc1);
System.out.printf("IMC da Pessoa 1 = %.1f - %s\n",imc1,classifica1);
static float calcularIMC(float p, float h)
return p/(h*h);
static String resultadoIMC(float imc)
String result;
if (imc > 10 && imc <= 18.5)
result = "Você está magro";
else
if (imc > 18.5 && imc <= 24.9)
result = "seu Imc está normal";
else
if (imc >= 25.0 && imc <= 29.9)
result = "Você está com sobrepeso";
else
if (imc >= 30.0 && imc <= 34.9)
result = "Você está com obesidade grau I";
else if(imc >= 35 && imc <= 39.9)
result = "Obesidade grau II";
else
result = "Você está com obesidade grau
III";
if(imc <= 10)
result =
"[ERRO] verifique as informações e tente novamente";
return result;