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 | |
|---|---|---|
| 1READFILE "Scores.txt", Score | AReads one data item from the open file Scores.txt and stores it in the variable Score | |
| 2OPENFILE "Scores.txt" FOR READ | BDECLARE Score : INTEGER READFILE "Scores.txt", Score | |
| 3The item read from the file is stored in the variable named after the file identifier | CThere is no OPENFILE ... FOR READ before READFILE, so the file is not open and cannot be read. | |
| 4The variable's data type must match the item being read, so an integer score needs an INTEGER variable | DMust be done before READFILE so the file is open in READ mode and ready to be read | |
| 5READFILE Score, "Scores.txt" | EREADFILE "Names.txt", PlayerName | |
| 6READFILE "Scores.txt", Score CLOSEFILE "Scores.txt" | FThe arguments are in the wrong order. The file identifier must come first, then the variable. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
READFILE "Scores.txt", Score — Reads one data item from the open file and stores it in the variable. The file must already be open in READ mode, and the variable's data type must match the item.DECLARE Score : INTEGER
OPENFILE "Scores.txt" FOR READ
READFILE "Scores.txt", ScoreOPENFILE "Scores.txt" FOR READ
READFILE "Scores.txt", ScoreDECLARE Score : INTEGER
OPENFILE "Scores.txt" FOR READ
READFILE "Scores.txt", ScoreOPENFILE "Scores.txt" FOR READ
READFILE "Scores.txt", ScoreOPENFILE "Scores.txt" FOR READ
READFILE "Scores.txt", Score
OUTPUT Score