This loop statement is also called as exit-controlled loop 1 4 2 a l ✓ o f o ✓ p ✓ i ✓ n ✓ g g ✓ r o 3 i ✓ t ✓ e ✓ r ✓ a ✓ t ✓ i ✓ o ✓ n i t 5 d ✓ o ✓ w ✓ h ✓ i ✓ l ✓ e m Question 18 Correct Mark 1.00 out of 1.00 Identify the logic which suits the flowchart? Select one:
Answer options
A
Do-while loop
B
for loop
C
nested loop
D
While loop
Your answer is correct. While loop checks for the condition first. Only if it is true, it enters the block. The statements gets repeated until
the condition becomes false.
The correct answer is: While loop
Question 19
Correct
Mark 1.00 out of 1.00
It's Halloween. You go from house to house, tricking or treating. You get 2 candies from each house that you go to. You must return
home once you collect 100 candies. Can you arrange the sequence for this loop activity.
1 BEGIN
2 SET candy count <- 0
3 END WHILE
4 DECLARE candy_count
5 WHILE candy_count<=100
6 candy count <- candy_count+2
7 END
E
1423657
F
1 4 5 2 3 6 7
G
1 4 2 5 6 3 7
H
1243657
Your answer is correct.
The correct answer is:
1425637
Question 20
Correct
Mark 1.00 out of 1.00
Looping statements are also called ____________
I
Iteration logic
J
Selection logic
Correct answer: Do-while loop
Explanation
The Do-while loop is the exit-controlled loop (condition checked after body executes). The word puzzle in the question spells out 'do while loop iteration'.