I am told to build a program called BMI calculator. It's just a simple program that prompts user to enter his/her height and weight, and then compute the BMI by the formula weight/(heightxheight). This is the code that I wrote..
double height=textBox1.Text;
int weight=textBox2.text;
double BMI = weight / (height * height);
MessageBox.Show("Your BMI is " + BMI);
it keeps saying things like "cannot implicitly convert" or "textbox does not contain definition".
Please help!
Can anyone tell me what's wrong in that?
2006-10-24
07:49:35
·
2 answers
·
asked by
sylvdoanx
2
in
Computers & Internet
➔ Programming & Design