Examlex

Solved

What Is Output by the Following Java Code Segment? Int

question 9

Multiple Choice

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


Definitions:

Atomic Symbol

A one or two-letter abbreviation derived from the English or Latin name of an element, representing it in the periodic table.

Atomic Symbol

A one or two-letter notation derived from the Latin name of an element, used to represent it in the periodic table and chemical equations.

Bromine

A chemical element with the symbol Br and atomic number 35, known as a reddish-brown liquid at room temperature and part of the halogen group.

Related Questions