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 | |
|---|---|---|
| 1INPUT Price Total ← Price * 2 OUTPUT Total | AThe calculation comes before the INPUT statements, so Length and Width have no values when Area is worked out. Move the calculation after both INPUTs. | |
| 2OUTPUT Total Total ← Price * 2 INPUT Price | BA sequence in the wrong order: Total is output before it has been calculated or Price has been input | |
| 3Swapping two statements changes the result: here A is set to 5, then B copies A, so B is 5 | CA ← 5 B ← A OUTPUT B | |
| 4Reading an algorithm from top to bottom: the second assignment replaces the first value, so the output is 9 | DX ← 4 X ← 9 OUTPUT X | |
| 5Area ← Length * Width INPUT Length INPUT Width OUTPUT Area | EA sequence: the value is input first, then calculated, then output, in that order from top to bottom | |
| 6INPUT Mark OUTPUT Percent Percent ← Mark / 50 * 100 | FOUTPUT is placed before the calculation, so Percent is displayed before it has been worked out. Swap the last two lines. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
sequence — Statements are carried out one after another in the order they are written, from top to bottom, so changing the order can change the result.INPUT Price
Total ← Price * 2
OUTPUT TotalINPUT Length
Area ← Length * Length
OUTPUT AreaTemp ← A
A ← B
B ← TempINPUT Price
Tax ← Price * 0.2
OUTPUT TaxTotal ← 10
Total ← Total * 2
OUTPUT Total