Double BMI;
Double Weight;
Double Height;
//Input
Console.WriteLine("Calculate BMI");
Console.WriteLine("");
Console.WriteLine("What is your weight in KG? ");
Weight = Double.Parse(Console.ReadLine());
Console.WriteLine("What is your height in metres? ");
Height = Double.Parse(Console.ReadLine());
//Process
BMI = Weight / (Height*Height);
double BMIround = Math.Round(BMI, 0);
//Output
if (BMI > 30)
{
Console.WriteLine("Your BMI is {0} which means your obese", BMIround);
}
else if (BMIround > 25 && BMIround < 29.9)
{
Console.WriteLine("Your BMI is {0} which means your overweight",
BMIround);
}
else if (BMIround > 18.5 && BMIround < 24.9)
{
Console.WriteLine("Your BMI is {0} which means your weight is normal",
BMIround);
}
else if (BMIround < 18.5)
{
Console.WriteLine("Your BMI is {0} which means your underweight",
BMIround);
}
Console.ReadLine();