Examlex

Solved

What Is Output by the Following Java Code Segment

question 32

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) ;
}
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!") ;
}


Definitions:

Major Term

In a syllogism, the predicate of the conclusion that appears in one of the premises.

Conclusion

The final part of an argument, statement, or process that follows logically from the premises or conditions.

Major Premise

The first proposition in a syllogistic argument, which contains the major term (the predicate of the conclusion) and makes a general statement.

Categorical Syllogism

A form of reasoning consisting of three statements - two premises followed by a conclusion, each statement categorically linking terms.

Related Questions