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:

Hostility

Aggressive attitudes or behaviors that can stem from feelings of anger or antipathy towards others.

Prejudice

Preconceived opinion that is not based on reason or actual experience; unfavourable feelings or attitudes towards individuals based on their membership in a particular group.

Hostility

Aggressive behavior or attitudes towards others, often stemming from anger or antagonism.

Central Route

A path of persuasion that involves careful and thoughtful consideration of the arguments presented.

Related Questions