Exam 4: Control Structures I: Selection
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of Java50 Questions
Exam 3: Introduction to Objects and Input/output50 Questions
Exam 4: Control Structures I: Selection50 Questions
Exam 5: Control Structures II: Repetition50 Questions
Exam 6: Graphical User Interface GUI and Object-Oriented Design OOD50 Questions
Exam 7: User-Defined Methods50 Questions
Exam 8: User-Defined Classes50 Questions
Exam 9: Arrays46 Questions
Exam 10: Inheritance and Polymorphism50 Questions
Exam 11: Handling Exceptions and Events50 Questions
Exam 12: Advanced Guis and Graphics48 Questions
Exam 13: Recursion50 Questions
Exam 14: Applications of Arrays Searching and Sorting and Strings50 Questions
Select questions type
If str1 is "Hello" and str2 is "Hi", which of the following could not be a result of str1.compareTo(str2);?
(Multiple Choice)
4.9/5
(38)
int x, y;if (x 4)
{
If (x > 7)
Y = 4;
Else
Y = 6;
}
Else
Y = 8;Based on the code above, what is the value of y if x = 9?
(Multiple Choice)
4.8/5
(36)
int x;
X = (1 'K' >= 'F') ? 5 : 12Based on the code above, what is the value of x?
(Multiple Choice)
4.8/5
(31)
Including a semicolon before the action statement in a one-way selection causes a syntax error.
(True/False)
4.9/5
(31)
int x, y;if (x 4)
{
If (x > 7)
Y = 4;
Else
Y = 6;
}
Else
Y = 8;Based on the code above, what is the value of y if x = 4?
(Multiple Choice)
5.0/5
(38)
'A' = 7 || 4 Based on the code above, which part of the expression is not evaluated?
(Multiple Choice)
4.9/5
(33)
int x, y;if (x 4)
{
If (x > 7)
Y = 4;
Else
Y = 6;
}
Else
Y = 8;Based on the code above, what is the value of y if x = 1?
(Multiple Choice)
4.9/5
(48)
Which of the following will cause a syntax error, if you are trying to compare x to 5?
(Multiple Choice)
4.8/5
(43)
What is the output of the following Java code?int x = 0;
If (x > 0)
System.out.println("positive ");
System.out.println("zero ");
System.out.println("negative");
(Multiple Choice)
4.9/5
(31)
Suppose P and Q are logical expressions. The logical expression P && Q is false if both P and Q are false.
(True/False)
4.9/5
(35)
The expression 'A' 'B' evaluates to false while the expression 'A' 'B' evaluates to true.
(True/False)
4.9/5
(37)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)