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 Age | AWaits for the user to type a value and stores it in the variable Age | |
| 2OUTPUT "Enter your name: " | BDECLARE Score : INTEGER INPUT Score | |
| 3The variable must be declared before it is used to store the input | CAge is an INTEGER, so the user cannot enter text like hello. The type decides what can be entered. | |
| 4Ask the user with OUTPUT first, then read their answer with INPUT | DShows a prompt so the user knows what to type before the INPUT statement | |
| 5INPUT "Age" | EINPUT needs a variable name (identifier), not a string in quotes. It should be INPUT Age. | |
| 6DECLARE Age : INTEGER INPUT Age // user types: hello | FOUTPUT "Enter a number: " INPUT Number |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
INPUT Answer — Reads a value typed by the user and stores it in the variable named after INPUT (here Answer). Declare the variable first; its data type decides what can be entered.DECLARE Age : INTEGER
OUTPUT "Enter your age: "
INPUT AgeDECLARE Name : STRING
OUTPUT "Enter your name: "
INPUT NameDECLARE Score : INTEGER
OUTPUT "Enter your score: "
INPUT ScoreDECLARE Price : REAL
OUTPUT "Enter the price: "
INPUT PriceDECLARE Colour : STRING
OUTPUT "Favourite colour? "
INPUT Colour