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 | |
|---|---|---|
| 1UCASE(SUBSTRING(Name, 1, 1)) | AShortCode ← UCASE(SUBSTRING(Code, 1, 3)) | |
| 2SUBSTRING(Name, 1, LENGTH(Name) - 1) | BGives the first letter of Name in capitals, such as an initial. SUBSTRING runs first, then UCASE changes its result. | |
| 3Store the first three letters of Code, in capitals, in a declared STRING variable | CSUBSTRING(Word, LENGTH(Word), 1) | |
| 4Use LENGTH inside SUBSTRING to pick out the last character of Word | DA closing bracket is missing. Each function call needs its own pair of brackets, so UCASE is never closed. | |
| 5UCASE(SUBSTRING(Name, 1, 1) | EGives every character of Name except the last one. | |
| 6SUBSTRING(Name, 1, LENGTH(Name - 1)) | FThe - 1 is inside LENGTH, so it tries to subtract 1 from a string. It should be outside the LENGTH brackets. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
UCASE(SUBSTRING(Name, 1, 1)) — Nesting string functions: the inner SUBSTRING runs first, then UCASE changes its result. This gives the first letter of Name in capitals, such as an initial.Initial ← UCASE(SUBSTRING(Name, 1, 1))Initial ← UCASE(SUBSTRING(Name, 1, 1))Short ← SUBSTRING(Name, 1, LENGTH(Name) - 1)DECLARE Initial : STRING
Initial ← UCASE(SUBSTRING(Name, 1, 1))Name ← "Maya"
Short ← SUBSTRING(Name, 1, LENGTH(Name) - 1)