Skip to main content

Practice · 2 of 4

BMI classifier

CHALLENGE
Difficulty: beginner+25 XP

Implement static string Bmi(double weightKg, double heightM) returning the BMI category: compute weight / (height*height); return "under" below 18.5, "normal" from 18.5 to below 25, "over" from 25 to below 30, "obese" at 30 or above.

Back to lesson: Practice: Flow under pressure