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 | |
|---|---|---|
| 1print "Name | Mark" | Aif count = 0 then print "No results found" | |
| 2for each record in results | Bprint "Records found: " + count | |
| 3When the query returns no records, the program prints a no results message instead of an empty list. | CThe fields have no separator, so the output runs together, such as Ava88. It needs a separator between the fields. | |
| 4After the loop, a summary line reports how many records were displayed. | DRepeats the loop body once for every record the query returned. | |
| 5for each record in results\n print "Name | Mark"\n print record.name + " | " + record.mark | EThe heading is printed inside the loop, so it repeats above every record. It should be printed once before the loop. | |
| 6print record.name + record.mark | FPrints a heading row once, before the loop, so each column of the results is labelled. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
for each record in results — Loops through the returned records, printing each as a formatted line under a heading, then prints a summary such as a count or total. If there are none, print a no results message.print "Name | Points"
for each record in results
print record.name + " | " + record.pointsprint "Name | Points"
for each record in results
print record.name + " | " + record.pointsfor each record in results
print record.name + " - " + record.points
end for count ← count + 1
end for
print "Total records: " + countif count = 0 then
print "No results found"
end if