DEV Community

Discussion on: Daily Challenge #57 - BMI Calculator

Collapse
 
fennecdjay profile image
Jérémie Astor • Edited

A solution in gwion

fun string bmi(float weight, float height) {
  height *=> height;
  weight / height => float bmi;
  if(bmi <= 18.5) 
    return "Underweight";
  if(bmi <= 25.0)
    return "Normal";
  if(bmi <= 30.0)
    return "Overweight";
  return "Obese";
}