Home     All Articles     RSS     Contact Search

Marketplace

Osteoporosis Risk Calculator

Posted on March 25, 2010.
Osteoporosis Risk CalculatorHelp programming class = expected?

I am building a calculator a bit more complicated BMI and received the message errror "Expected class, delegate, enum, interface or struct"

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 ("Warning, you have a high risk of heart disease and diabetes");
)
else
(If (BMI> = 23 & & <BMI = 27.4)
(
MessageBox.Show ("You have a moderate risk of heart disease and diabetes");
)
else
(If (BMI> = 18.5 & & <BMI = 22.9)
(
MessageBox.Show ("Congratulations, you're on the range in good health");
)
else
MessageBox.Show ("You risk deficiency diseases and osteoporosis");
)
)
)

Hello -

You write in Visual C + +, right?

Well, the code seems correct, but where did you "write" what is it? I suppose you've written for the "code" of your form, but you miss namespace header that defines this code as a reference to your form. It should look like this:

WHATEVER namespace (

double height = Convert.ToDouble (TextBox1.Text ...
double weight = Convert.ToDouble (TextBox2.Text ...

double BMI = weight / (height * height);
if (BMI> = 27.5)
(
MessageBox.Show ("Warning, you have a high risk of heart disease and diabetes");
)
else
(If (BMI> = 23 & & <BMI = 27.4)
(
MessageBox.Show ("You have a moderate risk of heart disease and diabetes");
)
else
(If (BMI> = 18.5 & & <BMI = 22.9)
(
MessageBox.Show ("Congratulatio ... you are on the range in good health");
)
else
MessageBox.Show ("You risk deficiency diseases and osteoporosis");
)
)
)

I hope that helps?

Fly

Share |

Comments

There are no comments.

Leave a Comment

Your Name
Your Email
Comments
Human Check. Type 6320.

Recent Posts
Vaginal Fungal Infection
Penile Candidiasis
Pcos Cancer
Cervical Whiplash
Full Hysterectomy
Virginia Surgery
Diet Plans
Yeast Infection Medication

My Friends
Bicycle Island
Scribblers
Paint Boxes
Brawlers.org
Druggy.net
astronautic.org
Hemp Camp
Fitness Clothing
Casual Clothing
Clothing Scene
Formal Clothes
Jewelry Boat