package practice;

import java.util.Scanner;

public class BMILevelByMethod {

	static String getBMILevelMsg(double bmiValue) {
		String bmiMsg="";
		
		if(bmiValue < 18.5) {
			bmiMsg = "저체중";
		}else if(bmiValue < 23 ) {
			bmiMsg = "정상 체중";
		}else if(bmiValue < 25 ) {
			bmiMsg = "과체중";
		}else if(bmiValue < 30 ) {
			bmiMsg = "비만";
		}else {
			bmiMsg = "고도비만";
		}
		
		return bmiMsg;
	}
	
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		
		System.out.println("BMI 계산");
		
		System.out.printf("키 입력(cm) : ");
		double cm = scan.nextDouble();
		
		System.out.printf("몸무게 입력(kg) : ");
		double kg = scan.nextDouble();
		
		double bmi = BMIValueByMethod.getBMIValue(kg, cm);
		
		System.out.printf("BMI수치는 %.2f\n",bmi);
		
		String msg = getBMILevelMsg(bmi);
		
		System.out.println(msg+" 삐빅");
		
		scan.close();
	}

}
