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 Grid : ARRAY[1:3, 1:3] OF INTEGER | AThis 2D array has 30 rows and 4 columns, so it holds 30 * 4 = 120 elements | |
| 2DECLARE Marks : ARRAY[1:30, 1:4] OF INTEGER | BThis 2D array has 3 rows and 3 columns, so it holds 3 * 3 = 9 elements | |
| 3The total number of elements in a 2D array is the number of rows multiplied by the number of columns | CThe sizes of the dimensions were added instead of multiplied. It should be 3 * 3 = 9 elements. | |
| 4The size of each dimension is the upper bound minus the lower bound plus one | DSize ← Upper - Lower + 1 | |
| 5ARRAY[1:3, 1:3] holds 3 + 3 = 6 elements | ETotal ← Rows * Columns | |
| 6ARRAY[1:30, 1:4] has 29 * 3 = 87 elements | FUpper minus lower was used without adding 1. It should be (30 - 1 + 1) * (4 - 1 + 1) = 30 * 4 = 120 elements. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
rows * columns — The total number of elements in a 2D array. Each dimension holds upper - lower + 1 values, so ARRAY[1:3, 1:3] holds 3 * 3 = 9 and ARRAY[1:30, 1:4] holds 30 * 4 = 120.rows ← 3
columns ← 4
total ← rows * columns// ARRAY[1:3, 1:3] holds 3 * 3 = 9 elements// 30 rows * 4 columns = 120 elements
DECLARE Marks : ARRAY[1:30, 1:4] OF INTEGERupper ← 30
lower ← 1
rowCount ← upper - lower + 1DECLARE Board : ARRAY[0:2, 0:3] OF CHAR
columns ← 3 - 0 + 1
OUTPUT 3 * columns