-6
I have the code below, which calculates BMI, you can tell me his mistake?
Follows the code:
import java.util.Scanner;
public class Paciente {
        public static double calcularIMC(double P,double A){
            double imc;
            imc=P/(A*A);
            return imc;
    }
        public static String diagnostico(){
            double A,P,imc;
            Scanner entrada=new Scanner(System.in);
            System.out.print("Entre com o valor de sua altura em metros :");
            A=entrada.nextInt();
            System.out.print("Entre com o valor de seu peso em Kg");
            P=entrada.nextInt();
            imc=Paciente.calcularIMC(P,A);
            if (imc<16.0){
                System.out.println("Baixo peso muito grave");
            }
            if (16<imc<16.99){
                System.out.println("Baixo peso grave");
            }
            if (17<imc<18.49){
                System.out.println("Baixo peso");
            }
            if (18.50<imc<24.99){
                System.out.println("Peso norma");
            }
            if(25<imc<29.99){
                System.out.println("Sobrepeso");
            }
            if(30<imc<34.99){
                System.out.println("Obesidade grau I");
            }
            if(35<imc<39.99){
                System.out.println("Obesidade grau II");
            }
            if(imc>=40){
                System.out.println("Obesidade grau II(obesidade morbida");
What mistake it makes?
– user28595
Friend specify your mistake, nobody here is soothsayer. Consider editing the question and asking what error you make when trying to do this calculation, and taking a look at the help area http://answall.com/help/how-to-ask to create questions with better formatting and more specific.
– Bruno Romualdo