Nathan Coulas

CCC '08 J1 - Body Mass Index

ccc08j1 JAVA8 05 Nov, 2019 0.912s 3 points

Source Code

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
Scanner in = new Scanner(System.in);
        float a = in.nextFloat();
        float b = in.nextFloat();
        b = a / (b * b);
        
        if(b < 18.5){
            System.out.println("Underweight");
        } else if(b >= 18.5 && b <= 25){
            System.out.println("Normal weight");
        } else{
            System.out.println("Overweight");
        }

    }
}