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 Mark | ATotal will hold a calculated sum of marks, so it needs a numeric data type such as INTEGER, not STRING. | |
| 2OUTPUT Average | BAn output found by underlining what the problem says must be displayed to the user | |
| 3The problem says 'enter 30 marks', so it needs a repeat. Plan a loop that runs 30 times. | CAn input found by underlining what the user enters, such as a mark in the problem | |
| 4The problem says 'if the mark is 50 or more, pass', so it needs a decision. Plan a selection. | DFOR Count ← 1 TO 30 | |
| 5DECLARE Total : STRING | EIF Mark >= 50 THEN | |
| 6OUTPUT Average Average ← Total / Count INPUT Total | FThe order is wrong: the plan is input, then process, then output. The output comes first and the input comes last. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Input, Process, Output — Plan before coding: read the problem, list what is input, what must be calculated or decided, and what is output. Then pick variables and spot repeats and decisions.INPUT Mark1
INPUT Mark2
OUTPUT (Mark1 + Mark2) / 2// Price of one item in dollars and cents
DECLARE Price : REALTotal ← Price * Quantity
OUTPUT TotalFOR Count ← 1 TO 10
INPUT Mark
NEXT CountIF Mark >= 50 THEN
OUTPUT "Pass"
ENDIF