-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathOutingDecision.java
More file actions
21 lines (20 loc) · 855 Bytes
/
OutingDecision.java
File metadata and controls
21 lines (20 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class outingDecision {
/*
* Assume you have access to two boolean variables, isSnowing, and isRaining, and one
double variable, temperature. isSnowing is true when it’s snowing and false otherwise,
isRaining is true when it’s raining and false otherwise, and temperature gives the outdoor
temperature in degrees Fahrenheit. Write code that prints “Let’s stay home.” if it’s raining,
snowing, or below 50 degrees Fahrenheit (10 degrees Celsius), and prints “Let’s go out!”
otherwise.
*/
public static void main(String[] args) {
boolean isSnowing = false;
boolean isRaining = true;
double temperature = 60.0;
if (isSnowing || isRaining || temperature < 50) {
System.out.println("Let's stay at home!");
}else {
System.out.println("Let's go out!");
}
}
}