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);
}
else
{
if (temp < 70)
{
System.out.println("This porridge is too cold.");

// warm up
temp = temp + (temp < 50 ? 30 : 20);
}
}

if (temp == 80)
System.out.println("This porridge is just right!");

a. This porridge is too hot.
b. This porridge is too cold.
This porridge is just right!
c. This porridge is just right!
d. None of the above.

d. None of the above.

Computer Science & Information Technology

You might also like to view...

Rewrite Program 100 so that two input values are provided to the function: the sound and a percentage of how far into the sound to go before changing from increasing to decreasing the volume.

What will be an ideal response?

Computer Science & Information Technology

Creating an archive with the tar command deletes the original data.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology