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 | |
|---|---|---|
| 1IF someone is at the door THEN open the door | A1. Show green 2. Show yellow 3. Show red | |
| 2REPEAT UNTIL alarm is turned off: ring again | BThe branch does the wrong action. When the light is red the cars should stop, not go. | |
| 3Sequence: a traffic light changes in the same order every time | CBranching: the automatic door makes a decision and only opens when its condition is true | |
| 4Branching: a self-serve checkout takes a different action depending on what happens | DIF item is scanned THEN beep ELSE show 'Try again' | |
| 51. Pay for items 2. Scan items 3. Pack bags | EThe steps are in the wrong order. A checkout sequence must scan the items before the customer pays. | |
| 6Traffic light: IF the light is red THEN go | FIteration: the alarm app repeats the same step over and over until a condition is met |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
sequence, branching, iteration — The three building blocks of algorithms: steps in order, decisions (IF) and repeats (loops). Traffic lights, self-serve checkouts, automatic doors and alarm apps all use them.IF pedestrian button is pressed THEN
turn the traffic light redIF person is near THEN open door
ELSE keep door shut1. Scan item
2. Put item in bag
3. Pay for itemsREPEAT FOREVER
change light to green
change light to redREPEAT UNTIL snooze is pressed
ring alarm