Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1count ← 0 | AA step box before the loop that sets the counter to 0 so counting starts from zero | |
| 2count ← count + 1 | BThe counter never goes up because there is no count ← count + 1 step inside the loop, so count = 5? is never Yes. | |
| 3The decision diamond asks if the counter has reached the target. Yes leaves the loop and No goes round again. | CA step box inside the loop that adds 1 to the counter each time round | |
| 4The counter must start at zero in a step box before the loop begins | Dcount ← 0 | |
| 5Loop step box: count ← 0 (inside the loop, before the diamond count = 5?) | Ecount = 5? Yes or No | |
| 6Loop: Print Hello, then diamond count = 5? and no step box that adds 1 to count | Fcount is set back to 0 every time round the loop, so it never reaches 5 and the loop never ends. Set it to 0 once before the loop. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
count ← count + 1 — A flowchart counter: set count to 0 in a step box, add 1 inside the loop, then ask count = 5? in a diamond. Yes leaves the loop, No goes round again.Step box: count ← 0Loop step box: count ← count + 1Loop step box: count ← count + 1Diamond: count = 5?Diamond: count = 5?
Yes -> leave the loop
No -> go round again