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 Names : ARRAY[1:30] OF STRING | AThe array is 1D but is used with two indexes. Marks for students and tests form a table, so it should be declared as 2D: ARRAY[1:30, 1:4] OF INTEGER. | |
| 2DECLARE Board : ARRAY[1:3, 1:3] OF CHAR | BA 1D array: one simple list of 30 names, where each name is found using a single index | |
| 3Marks for 30 students over 4 tests form a table, so each mark needs a student (row) and a test (column) | CNames[5] <- "Ava" Scores[5] <- 88 | |
| 4Parallel 1D arrays store related lists side by side, and the same index links the matching items | DDECLARE Marks : ARRAY[1:30, 1:4] OF INTEGER | |
| 5DECLARE Marks : ARRAY[1:120] OF INTEGER Marks[3, 2] <- 75 | EA simple list of names needs only one index, so a 2D array is unnecessary. It should be DECLARE Names : ARRAY[1:30] OF STRING and Names[7] <- "Zoe". | |
| 6DECLARE Names : ARRAY[1:30, 1:1] OF STRING Names[7, 1] <- "Zoe" | FA 2D array: a 3 by 3 game board grid, where each square is found using a row and a column |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
1D or 2D array — Use a 1D array for a simple list of values. Use a 2D array when data forms a table or grid, so each value needs two indexes: a row and a column.DECLARE Names : ARRAY[1:30] OF STRINGDECLARE Board : ARRAY[1:3, 1:3] OF CHARDECLARE Marks : ARRAY[1:30, 1:4] OF INTEGER// mark for each student and test
OUTPUT Marks[Student, Test]// parallel 1D arrays share one index
OUTPUT Names[I], Marks[I]