Examlex

Solved

What Is Output by the Following Java Code Segment

question 12

Multiple Choice

What is output by the following Java code segment?
Int temp = 180;
While (temp != 80)
{
If (temp > 90)
{
System.out.print("This porridge is too hot! ") ;
// cool down
Temp = temp - (temp > 150 ? 100 : 20) ;
}
Else
{
If (temp < 70)
{
System.out.print(
"This porridge is too cold! ") ;
// warm up
Temp = temp + (temp < 50 ? 30 : 20) ;
}
}
}
If (temp == 80)
System.out.println("This porridge is just right!") ;


Definitions:

Society

A structured community of people bound together by similar traditions, institutions, or nationality.

Logrolling

The trading of votes by legislators to secure favorable outcomes on decisions concerning the provision of public goods and quasi-public goods.

Diminish

To decrease or make smaller in size, importance, or intensity.

Excludability

The characteristic displayed by those goods and services for which sellers are able to prevent nonbuyers from obtaining benefits.

Related Questions