如果Java卡住,则小于或等于Else
该程序输入一个温度,并根据该温度输出一条消息。我的程序卡住了(超过50) System.out.println(“享受天气”);如果Java卡住,则小于或等于Else,java,if-statement,Java,If Statement,该程序输入一个温度,并根据该温度输出一条消息。我的程序卡住了(超过50) System.out.println(“享受天气”); 否则,如果(tempOutside所有int都是>50或的话,如果您可以直接提到您的确切问题,然后是您的实现,那么会更清楚,因为这里的问题看起来可能有误解。 但我想也许这就是这里被问到的问题 if (tempOutside > 50) { System.out.println("Enjoy the weather"); }
否则,如果(tempOutside所有
int
都是>50
或的话,如果您可以直接提到您的确切问题,然后是您的实现,那么会更清楚,因为这里的问题看起来可能有误解。
但我想也许这就是这里被问到的问题
if (tempOutside > 50)
{
System.out.println("Enjoy the weather");
}
else if (tempOutside <= 50)
{
if(tempOutside <= 30)
{
if(tempOutside <= -10)
{
System.out.println("BUNDLE UP it's \"COLD\" outside ");
}
else {
System.out.println("Check the gas in you car before leaving");
}
}
else
{
//when the temp is between 30 and 50
System.out.println("Time to turn on the heat");
}
}
if(tempOutside>50)
{
System.out.println(“享受天气”);
}
如果(临时)在外面
> 30
> -10
if (tempOutside > 50)
{
System.out.println("Enjoy the weather");
}
else if (tempOutside <= 50)
{
if(tempOutside <= 30)
{
if(tempOutside <= -10)
{
System.out.println("BUNDLE UP it's \"COLD\" outside ");
}
else {
System.out.println("Check the gas in you car before leaving");
}
}
else
{
//when the temp is between 30 and 50
System.out.println("Time to turn on the heat");
}
}