Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

peso

import java.util.Scanner;
 
public class ProgramacondicionesAnidadas2 {
    public static void main(String[] args) {
        Scanner teclado=new Scanner(System.in);
        //----------------VARIABLES---------------
        double p,e,imc;
        //----------------ENTRADAS----------------
        System.out.println("Cual es su peso ");
        p= teclado.nextDouble();
        System.out.println("Cual es tu estatura");
        e= teclado.nextDouble();
        //----------------CALCULO----------------
        imc= p/(e*e);
        System.out.println("SU IMC ES: "+imc);
        //--------SITUACION IMC POR PERSONA-------    
        if (imc<18.5) {
            System.out.println("BAJO PESO");
        } else if (imc>=18.5 && imc<=24.9) {
            System.out.println("NORMAL");
        } else if (imc>=25 && imc<=29.9) {
            System.out.println("SOBREPESO");
        } else {
            System.out.println("OBESIDAD");
        }
    }
 
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.