帮我改下这个JAVA程序。。谢谢
来源:百度知道 编辑:UC知道 时间:2024/06/25 22:39:05
public class WomenFigure {
public static void main(String[]args){
Scanner scanner = new Scanner(System .in);
System .out .println("Please you fill in Waist"); //Waist:腰围 Hip:臀围
System .out .println("\nPlease you fill in Hip");
double figure;
double Waist;
double Hip;
double Waist/Hip = scanner .nextDouble();
if(figure<=0.85)
System .out .println("nomral;"+figure);
else
System .out .println("pearfigure;"+figure);
}
}
在double Waist/Hip = scanner .nextDouble();中Waist重复
double Waist/Hip ? 我有点问题~
nomral 应该是 noraml
循环输入 Waist:腰围 和 Hip:臀围 ,然后计算判断 ,如果不是这样,你再改改吧~~
代码复制进去呢运行下吧~~
public static void main(String[]args){
double figure;
double waist;
double hip;
Boolean go = false;
try {
do{
Scanner scanner = new Scanner(System .in);
System .out .println("Please you fill in Waist"); //Waist:腰围 Hip:臀围
waist = scanner.nextDouble();
System .out .println("\nPlease you fill in Hip");
hip = scanner.nextDouble();
figure = waist/hip;
if(figure<=0.85) {
System .out .println("nomral:"+figure);
}else {
System .out .println("pearfigure:"+figure);
}
System.out.print("继续输入吗?Y/N");
go = scanner.next().equalsIgnoreCase("Y");