請問一下java程式!!求救!!..!!!

class Body { double h,w; boolean sex; Body(){ } Body(double h,double w) { this.h=h; this.w=w; } Body(double h,boolean sex) { this.h=h; } Body(double h,double w,boolean sex) { this.h=h; this.w=w; this.sex=sex; } double BMI() { double t=h/100; return w/(t*t); } double... 顯示更多 class Body
{
double h,w;
boolean sex;
Body(){
}
Body(double h,double w)
{
this.h=h;
this.w=w;
}
Body(double h,boolean sex)
{
this.h=h;

}
Body(double h,double w,boolean sex)
{
this.h=h;
this.w=w;
this.sex=sex;
}
double BMI()
{
double t=h/100;
return w/(t*t);
}
double stdWeight()
{
if(sex)
return (h-80)*0.7;
else
return (h-70)*0.6;
}
}

public class BodyMain {

public BodyMain() {
}
public static void main (String[] args) {
java.util.Scanner keyin=new java.util.Scanner(System.in);




System.out.print("身高:");
double a=keyin.nextDouble();
System.out.print("體重:");
double b=keyin.nextDouble();
System.out.print("性別:");
System.out.print("男生選B:女生選G:");
char c=keyin.next().charAt(0);

Body e=new Body(a,b,c);

System.out.println("BMI="+e.BMI());
System.out.println("StdWeight="+e.stdWeight());
}

}
為什麼無法編譯呢??
3 個解答 3