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 ) ;
} // end if
Else
{
If ( temp < 70 )
{
System.out.print(
"This porridge is too cold! ") ;
// warm up
Temp = temp + (temp < 50 ? 30 : 20) ;
} // end if
} // end else
} // end while
If ( temp == 80 )
System.out.println( "This porridge is just right!" ) ;
A) This porridge is too cold! This porridge is just right!
B) This porridge is too hot! This porridge is just right!
C) This porridge is just right!
D) None of the above.
Correct Answer:

Verified
Correct Answer:
Verified
Q3: Sentinel-controlled repetition is also known as:<br>A)Definite repetition.<br>B)Indefinite
Q5: Which of the following segments is a
Q6: Which statement is false?<br>A)Both syntax errors and
Q7: How many times is the body of
Q9: What is output by the following Java
Q11: Which of the following operators associates from
Q21: Which of the following statements about the
Q24: Which of the following is the shape
Q25: Which of the following is not an
Q34: The empty statement is denoted by what