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!");
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.
b. This porridge is too hot! This porridge is just right!
You might also like to view...
Filters dynamically update the current view of the project as the project is modified.
Answer the following statement true (T) or false (F)
A ____ is a hardware device or software program designed to prevent any write operations from taking place on the original media.
A. read-blocker B. selective write filter C. selective filter D. write-blocker