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

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter6: Sub And Function Procedures
Section: Chapter Questions
Problem 2RQ
icon
Related questions
Question

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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Returning value from Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning