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 | |
|---|---|---|
| 1OPENFILE "Scores.txt" FOR READ | AOPENFILE "Results.txt" FOR READ | |
| 2OPENFILE "Names.txt" FOR READ READFILE "Names.txt", Name | BREADFILE is used before the file is opened. OPENFILE ... FOR READ must come first. | |
| 3A file must be opened in READ mode before any data is read from it | COpens Names.txt first, then reads one line from it into the variable Name | |
| 4READ mode opens a file that already exists and holds data, so it is not used to create a new file | DOpens the existing file Scores.txt so the program can read data from it | |
| 5OPENFILE Scores.txt FOR READ | EOPENFILE "Scores.txt" FOR READ READFILE "Scores.txt", Score | |
| 6READFILE "Scores.txt", Score OPENFILE "Scores.txt" FOR READ | FThe file name is not in quotation marks. The file identifier must be a string, so it should be "Scores.txt". |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
OPENFILE "Scores.txt" FOR READ — Opens the existing file Scores.txt in READ mode so the program can read data from it with READFILE. The file must already exist, and READ mode does not change its contents.OPENFILE "Scores.txt" FOR READOPENFILE "Scores.txt" FOR READOPENFILE "Scores.txt" FOR READOPENFILE "Scores.txt" FOR READ
READFILE "Scores.txt", ScoreDECLARE Score : INTEGER
OPENFILE "Scores.txt" FOR READ
READFILE "Scores.txt", Score