我做了4节课。头等舱
public void bust(String[] args) {
@SuppressWarnings("resource")
Scanner user_input = new Scanner(System.in);
System.out.print("Enter your Bust Size: ");
int bust_size1 = user_input.nextInt();
int y = bust_size1;
if (y>=33 & y<=34.5) {
System.out.println("You are Small Bust" );
} else if (y>=35 & y<37 ) {
System.out.println("You are Medium Bust");
} else if (y>=37 & y<=40.5) {
System.out.println("You are Large Bust");
} else {
System.out.println("sorry you entered a incorrect number,");
}
}
// 所有的类看起来都相似,然后我的主类将这 3 个类放在一起-
public static void main(String[] args) {
bust bustmain = new bust();
hip hipmain = new hip();
waist waistmain = new waist();
bustmain.bust(args);
waistmain.waist(args);
hipmain.hip(args);
}
我想要实现的正是这个:我希望用户输入他们的胸围、腰围和臀围的数字。如果他们输入诸如 33 之类的数字,他们将属于小类别,我将小类别设置为诸如 1 之类的值。然后将添加这些值以确定它们将是什么。