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 | |
|---|---|---|
| 1'Y' | AIsValid ← TRUE | |
| 2"" | BAn empty STRING literal: double quotes with nothing between them | |
| 3A REAL literal needs a digit on both sides of the decimal point | CPrice ← 4.0 | |
| 4A BOOLEAN literal is TRUE or FALSE, written in capitals | DA CHAR literal must use single quotes, not double quotes. Double quotes make it a STRING. It should be 'A'. | |
| 5Grade ← "A" (Grade is a CHAR) | EA REAL literal needs a digit after the decimal point. 4. should be written as 4.0. | |
| 6Total ← 4. | FA CHAR literal: one character inside single quotes |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
'Y' "Yes" 4.0 TRUE — Literals have fixed forms: CHAR in single quotes, STRING in double quotes, REAL with a digit each side of the point, BOOLEAN as TRUE or FALSE in capitals.DECLARE Grade : CHAR
// Store the letter A
Grade ← 'A'DECLARE Name : STRING
// Start with no text at all
Name ← ""DECLARE Price : REAL
// The price is exactly four
Price ← 4.0DECLARE Found : BOOLEAN
// Nothing has been found yet
Found ← FALSEDECLARE Temp : INTEGER
// Three degrees below zero
Temp ← -3