I build a slightly more complicated BMI calculator and got the errror message "Expected class, delegate, enum, interface, or struct"
this is the code I wrote
{
double height = Convert.ToDouble(textBox1.Text);
double weight = Convert.ToDouble(textBox2.Text);
double BMI = weight / (height * height);
if (BMI >= 27.5)
{
MessageBox.Show("Be careful, you have high risk of heart disease and diabetes");
}
else
{if (BMI>=23 && BMI<=27.4)
{
MessageBox.Show("You have moderate risk of heart disease and diabetes");
}
else
{if (BMI>=18.5 && BMI<=22.9)
{
MessageBox.Show("Congratulations, you're on healthy range");
}
else
MessageBox.Show("You have Risk of nutritional deficiency diseases and osteoporosis");
}
}
}
2006-10-25
01:57:42
·
1 answers
·
asked by
sylvdoanx
2