Question 3(c) 2016 · May-June · Paper 22 · 8 marks
Reveal official mark-scheme answer


Official answer for Question 3
Part (c)
Part (c)
Example VB:
Question 22
- all 3 initialisations
- outer loop correctly formed
- inner loop correctly nested
- procedure call with all parameters
- 3 IF statements, not nested
- assign NextNumber to AcrossList and DownList
- increment a, d, NextNumber
- assign NextNumber to Puzzle element
Question 22
Show text version of question
Question 3
Part (c)
Question 3
A crossword puzzle is based on a grid made up of white and black squares. The white squares are
to be filled with letters to form words across the grid and down the grid.
The crossword puzzle designer provides clues for each word. Words consist of at least 2 letters.
The square where a word starts, across or down, is numbered. The numbering starts at the top left of the grid and is consecutive, row by row.
Here is an example of a crossword grid:
1 2 3 4 5 6
7 8
9 10 11
12 13 14
Question 15
16 17
18 19
Part (c)
Zara wants her program to number the squares where a word starts. She also wants the
program to create two lists, AcrossList and DownList.
AcrossList will contain the numbers of the starting squares of words going across. DownList will contain the numbers of the starting squares of words going down.
Note that a square can be a starting square for a word going across and a word going down. The same number would therefore be contained in both lists.
For example, the given puzzle has these lists. Squares numbered 5, 12 and 17 are starting squares for words going across and words going down.
1 2 3 4 5 6 AcrossList DownList
1 2 7 8
5 3 7 4 9 10 11
8 5
13 14 9 6
Question 12
Question 15
11 10
16 17 12 12 13 14
18 19 16 15 17 17
Question 18
Question 19
Question 12
Zara designs this part of the program by writing pseudocode.
Convert this pseudocode into program code.
NextNumber ← 1 // first number for numbering starting squares a ← 1 // pointer to first element of AcrossList d ← 1 // pointer to first element of DownList FOR ThisRow ← 1 TO 11 FOR ThisColumn ← 1 TO 11 CALL CheckForStartOfWord(Puzzle, ThisRow, ThisColumn, Across, Down) IF Across = TRUE THEN AcrossList[a] ← NextNumber // update AcrossList a ← a + 1 ENDIF IF Down = TRUE THEN DownList[d] ← NextNumber // update DownList d ← d + 1 ENDIF IF Across = True OR Down = TRUE THEN Puzzle[ThisRow, ThisColumn] ← NextNumber // number the square NextNumber ← NextNumber + 1 ENDIF ENDFOR ENDFOR
Question 13
Programming language ...........................................................................................................................
Code ........................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
.............................................................................................................................................................
Question 14
Why this question appears here
82% assigned-topic match · Hardware › Logic gates and logic circuits
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9691_s16_qp_22.pdf
