我正在为我所在的班级做一个项目,任务是制作一个需要Netbeans
3 个输入的程序,
人的身高,
背部问题
心脏问题。
老师说这两题要用boolean。他希望我们用它来inputBack.equals("N")
看看它是否等于N
我得到的输入,无论如何,如果有人可以帮助我,我会将我的代码放在下面,那就太好了!
基本上,程序仅在我更改高度时输出不同,但我需要它在b
或h
时显示其他内容Y
。
double H;
String b, h;
b = back.getText();
h = heart.getText();
H = Double.parseDouble(height.getText());
if (h.equals("Y") || b.equals("Y")) {
output.setText("Sorry, its not safe for you to ride the coaster");
}
if ((H >= 122 && H <= 188) && (h.equals("N") || b.equals("N"))) {
output.setText("You are cleared to ride, have fun!");
} else if (b.equals("Y") || h.equals("Y")) {
output.setText("Sorry, its not safe for you to ride the coaster");
} else {
output.setText("Sorry, its not safe for you to ride the coaster");
}
暮色呼如
MMTTMM
30秒到达战场
相关分类