1- The following code displays ____. double temperature = 50; if (temperature >= 100) System.out.println("too hot"); else if (temperature <= 40) System.out.println("too cold"); else System.out.println("just right"); just right too hot too hot too cold just right too cold
1- The following code displays ____.
double temperature = 50;
if (temperature >= 100)
System.out.println("too hot");
else if (temperature <= 40)
System.out.println("too cold");
else
System.out.println("just right");
just right
too hot
too hot too cold just right
too cold
2- Assume x is 0. What is the output of the following statement?
if (x > 0)
System.out.print("x is greater than 0");
else if (x < 0)
System.out.print("x is less than 0");
else
System.out.print("x equals 0");
x is less than 0
x equals 0
x is greater than 0
None
3- The expression 2 + 4 / (5 - 3) * 2 is evaluated to ____.
1.5
6
8
3
4- if you attempt to add an int value and a double value, the result will be a ____ value.
Is not allowed.
If the first number is int value then the result will be int value and if the first number is double value then the result will be double value.
int
double
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images