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 | |
|---|---|---|
| 1Counter ← 1 | AProcess box before the test: sets the loop counter to its starting value once, before the loop begins | |
| 2Counter <= 10 | BThe counter is reset to 1 on every pass, so it never reaches 10 and the loop never ends. The start value must be set once before the test. | |
| 3After the loop body, the counter is increased by 1 in a process box, then a flow line returns to the test | CCounter ← Counter + 1 | |
| 4The test comes before the body, so a FOR loop flowchart sets the counter first and checks it before running any body statements | DDecision diamond: tests whether the loop should run again, Yes goes to the body and No leaves the loop | |
| 5Counter ← 1 placed inside the loop, after the body and just before the flow line back to the test | ECounter ← 1 then Counter <= 10 ? | |
| 6Body, then flow line straight back to the test with no Counter ← Counter + 1 box | FThe counter is never increased, so Counter <= 10 stays true forever and the loop runs endlessly. A process box adding 1 is missing. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
FOR loop flowchart — Set Counter ← 1 in a process box, test Counter <= 10 in a decision, run the body on Yes, then do Counter ← Counter + 1 and flow back to the test. No leaves the loop.Process box: Counter ← 1Decision box: Counter <= 10After body: Counter ← Counter + 1Decision: Counter <= 10? Yes runs the bodyDecision: Counter <= 10? No leaves the loop