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 | |
|---|---|---|
| 1DECLARE LineOfText : STRING | AThe colon is missing between the identifier and the data type. It should be DECLARE LineOfText : STRING. | |
| 2DECLARE Score : INTEGER | BDECLARE PlayerName : STRING | |
| 3Declare the variable first, then use it to store a line read from the file | CCreates a variable called LineOfText that can hold a line of text read from or written to a file | |
| 4Give the variable a meaningful name and the correct data type for the file data | DCreates a variable called Score that can hold a whole number, such as a value read from a file | |
| 5READFILE "Notes.txt", LineOfText DECLARE LineOfText : STRING | EThe variable is declared after READFILE uses it. DECLARE must come before the file command that uses the variable. | |
| 6DECLARE LineOfText STRING | FDECLARE LineOfText : STRING READFILE "Notes.txt", LineOfText |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
DECLARE LineOfText : STRING — Creates a variable named LineOfText that holds text. Declare it before the file commands that use it, for example before READFILE stores a line in it.DECLARE LineOfText : STRINGDECLARE LineOfText : STRINGDECLARE Score : INTEGERDECLARE LineOfText : STRING
OPENFILE "Notes.txt" FOR READ
READFILE "Notes.txt", LineOfTextDECLARE Score : INTEGER
OPENFILE "Scores.txt" FOR WRITE
WRITEFILE "Scores.txt", Score