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 | AAssignment uses = instead of the arrow <-. It should be Score <- 10. | |
| 2Total <- Price * 2 INPUT Price OUTPUT Total | BOUTPUT comes before the assignment, so Total has no value when it is output. The two statements must be swapped. | |
| 3A sequence program starts by declaring its variables, then takes input, then outputs a result | CA <- 5 B <- A + 3 OUTPUT B | |
| 4A program with no selection or iteration is a pure sequence: every statement runs exactly once, in order | DA sequence of input, then process, then output: the statements run once each, in order, from top to bottom | |
| 5OUTPUT Total Total <- 4 + 6 | EThe order is wrong: Price is used in the calculation before it has been given a value from INPUT | |
| 6DECLARE Score : INTEGER Score = 10 OUTPUT Score | FDECLARE Age : INTEGER INPUT Age OUTPUT Age + 1 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
sequence — A program made of statements like DECLARE, <-, INPUT and OUTPUT that run one after another from top to bottom, with no selection or iteration. Changing the order changes the result.DECLARE Price : INTEGER
INPUT Price
OUTPUT PriceINPUT Price
Total ← Price * 3
OUTPUT TotalCount ← 0
Count ← Count + 1
OUTPUT CountDECLARE Name : STRING
INPUT Name
OUTPUT NameINPUT Mins
Secs ← Mins * 60
OUTPUT Secs