♪£yricảl♪
2008-06-09 00:08:49 UTC
public class Compute BMI {
public static void main (String [ ] args) {
double weight, height;
float bmi;
weight = 55.0;
Height = 1.7;
bmi = weight / (height * height);
System.out.println ("BMI = " + bmi);
if bmi <= 19.5
System.out.println ("Underweight");
else if (bmi > 26.0)
System.out.println ("Overweight");
}
}
My answers:
1st error: the Height at line 9 should be small letter (that is, height because it has been declared (is it declare?) that it is height, not Height.)
2nd error: The System.out.println at line 13 should be placed at the end of the if and else if statement..(i don't know how to explain why that is so though..help? thanks)
What are the other 2 errors? I can't seem to spot them..o.o?
And, the first 2 errors that I have pointed out, are them correct? If they are not errors, do tell me..thanks