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) ;
}
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.
Correct Answer:

Verified
Correct Answer:
Verified
Q1: Where can local variables declared within a
Q2: Which statement is true?<br>A) Dividing two integers
Q3: Which of the following statements is true?<br>A)
Q5: Which of the following statements is false?<br>A)
Q6: What does the expression x %= 10
Q7: What is the result value of c
Q8: Which statement is false?<br>A) Unless directed otherwise,
Q9: A decision symbol in an activity diagram
Q10: Counter-controlled iteration is also known as:<br>A) Definite
Q11: Which of the following operators associates from