Professional Documents
Culture Documents
Test JFo Section 6 Quiz
Test JFo Section 6 Quiz
Section 6 Quiz
(Answer all questions in this section)
1. You need to calculate the squares of numbers from 1 to 5. Which of the items should be
present in your looping statement?
(1/1) Points
Initialization Expression , Condition Expression
Condition Expression , Update Expression
Initialization Expression , Update Expression
Initialization Expression , Condition Expression , Update Expression (*)
Correct
3. Which two operators cannot be used as the conditional expression in a for loop?
(Choose all correct answers)
(1/1) Points
==
!< (*)
!> (*)
!=
<
Correct
4. The for loop provides a complicated way to iterate over a range of values.
(1/1) Points
True
False (*)
Correct
8. A do-while will always execute statements contained in the loop at least once.
(1/1) Points
True (*)
False
Correct
10. A post-test loop evaluates its condition at the end of the loop instead of the beginning.
(1/1) Points
True (*)
False
11. Which of the two are pre-test loops?
(Choose all correct answers)
(1/1) Points
do-while
forEach
for (*)
while (*)
Correct
12. Which two statements are true about the while loop.
(Choose all correct answers)
(1/1) Points
If the condition of a pre-test loop is false, the statements in the loop are never executed. (*)
If the condition of the loop is true initially, the statements are never executed.
The statement in a while loop will execute zero or more times. (*)
The statements of a while loop will execute one or more times.
Correct
14. The purpose of adding comments is to increase the ability to understand the logic easily.
(1/1) Points
True (*)
False
Correct
15. A continue statement is used to skip the remaining statements in the body of a loop and
continue with the next iteration of the loop.
(1/1) Points
True (*)
False
Correct