Section 5 Quiz
Section 5 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 5 Quiz
(Answer all questions in this section)
1. The switch statement is a more efficient way to write code when dealing with a large
range of unknown values.
Mark for Review
(1) Points
True
False (*)
Correct
(1) Points
A
Congratulations! Good Work Average Barely Passing Failed (*)
Congratulations!
Failed
Correct
3. Which two of the following data types can be used in a switch statement?
Mark for Review
(1) Points
float
String(*)
int(*)
boolean
Correct
(1) Points
Vowels
Compilation error
Vowels
Consonants (*)
Correct
(1) Points
0/1
good/bad
true/false (*)
yes/no
Correct
6. Which three are conditional statements?
Mark for Review
(1) Points
switch statement(*)
do while loop
if/else statement(*)
if statement(*)
for loop
Correct
(1) Points
Java Programming
JavaProgramming
True (*)
False
Correct
8. The equal sign (=) is used to make an assignment, whereas the == sign merely
makes a comparison and returns a boolean.
Mark for Review
(1) Points
True (*)
False
Correct
(1) Points
No output
Bob is 43 (*)
Bob is 50
Bob is 43 Bob is 50
Correct
(1) Points
~=
The equals() method (*)
==
=
Correct
11. A String comparison with == compares the Strings’ locations in memory and not the
content of the String.
Mark for Review
(1) Points
True (*)
False
Correct
(1) Points
%(*)
&&
||
+(*)
Correct
13. In the AND (&&) test, if the first expression on the left hand side is false, then there
is no need to evaluate the second statement.
Mark for Review
(1) Points
True (*)
False
Correct
14. What is the result?
(1) Points
I scored 1 point
Compilation error
I scored 1 point 10 points
I scored 10 points (*)
Correct
15. In a boolean expression which uses the && operator, what would make this
expression evaluate to true?
(1) Points
If the first condition is true, but the second condition is false
If both the first condition and second condition are false
If both the first condition and second condition are true (*)
If the first condition is false, but the second condition is true
Correct