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 | |
|---|---|---|
| 1Grid[Row, Column] ← 'O' | AWrites 'O' into the element whose row number is stored in Row and whose column number is stored in Column | |
| 2Grid[Row+1, Column] | BWith 3 rows (1:3), Row+1 is 4, which is outside the upper bound, so the index is out of range. | |
| 3Store the row and column numbers in variables first, then use both variables as the indexes to set one element | CRow ← 2 Column ← 3 Grid[Row, Column] ← 'O' | |
| 4Both index variables must stay within the declared bounds, such as ARRAY[1:3, 1:4], or the access is out of range | DUses an expression for the row index, so it reaches the element one row below the current one in the same column | |
| 5Grid["Row", "Column"] ← 'O' | ERow ← 4 OUTPUT Grid[Row, Column] | |
| 6Row ← 3 OUTPUT Grid[Row+1, Column] | FThe variable names are in quotes, so they are treated as text, not as the numbers stored in the variables. Indexes must be whole numbers. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Grid[Row, Column] — Uses two variables as the row and column indexes, so one statement can reach any element of a 2D array. Both variables must stay within their bounds.Row ← 2
Column ← 3
Grid[Row, Column] ← 'O'Row ← 2
Column ← 3
OUTPUT Grid[Row, Column]Row ← 2
Column ← 3
Grid[Row + 1, Column] ← 'O'DECLARE Grid : ARRAY[1:3, 1:4] OF CHAR
Column ← 4
Grid[2, Column] ← 'O'Row ← 1
Column ← 2
OUTPUT Grid[Row, Column]