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 | |
|---|---|---|
| 1score >= 50? | Ai <= 5? Yes -> n > 3? -> ... -> i <- i + 1 -> back to i <= 5? | |
| 2i <- i + 1, then arrow to i <= 10? | BThe counter update, then back to the loop test | |
| 3Both the Yes and No branches rejoin before the loop test | CYes: count <- count + 1 -> join. No: join. Then i <- i + 1 -> i <= 10? | |
| 4The decision is asked again on every pass of the loop | DThe No branch goes to Stop instead of rejoining. The loop would end the first time the answer is No. It should rejoin and go back to the loop test. | |
| 5n > 5? No -> Stop (Yes -> count <- count + 1 -> i <- i + 1 -> i <= 10?) | EA decision diamond inside the loop that is asked on every pass | |
| 6n > 5? Yes -> count <- count + 1 -> i <- i + 1. No -> i <= 10? | FThe counter update is only on the Yes branch. When the answer is No, i never changes, so the loop may never end. Rejoin the branches first, then update i. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
decision inside a loop — A diamond on the loop path is asked on every pass. Both its Yes and No branches rejoin, then go back to the loop test, usually after the counter update.A decision in a loop is drawn as a diamondIs score > 10?
Yes -> count <- count + 1
No -> go to counter updateBoth branches go back to the loop testCounter update: i <- i + 1The diamond is asked every pass