Past-paper question · 2016 May-June · Paper 22 · Q3(c)

Question 3(c) 2016 · May-June · Paper 22 · 8 marks

Original past-paper question for 3(C)
Original past-paper question for 3(C)
Original past-paper question for 3(C)
Original past-paper question for 3(C)
Original past-paper question for 3(C)
Original past-paper question for 3(C)
Original past-paper question for 3(C)
Reveal official mark-scheme answer Official mark-scheme answer for 3(C)Official mark-scheme answer for 3(C)Official mark-scheme answer for 3(C)

Official answer for Question 3

Part (c)

Part (c)

Example VB:

[8]
✓
NextNumber = 1
✓
a = 1
✓
d = 1
✓
FOR ThisRow = 1 TO 11
✓
FOR ThisColumn = 1 TO 11
✓
CheckStartOfWord(ThisRow, ThisColumn, Across, Down)
✓
IF Across = TRUE THEN
✓
AcrossList(a) = NextNumber
✓
a = a + 1
✓
END IF
✓
IF Down = TRUE THEN
✓
DownList(d) = NextNumber
✓
d = d + 1
✓
END IF
✓
IF (Across = TRUE) OR (Down = TRUE) THEN
✓
Puzzle(ThisRow, ThisColumn) = NextNumber
✓
NextNumber = NextNumber + 1
✓
END IF
✓
NEXT ThisColumn
✓
NEXT ThisRow
✓
Example Python:
✓
NextNumber = 1
✓
a = 1
✓
d = 1
✓
(1)
✓
for ThisRow in range(1, 12):
✓
(1)
✓
for ThisColumn in range(1,12):
✓
(1)
✓
CheckStartOfWord(ThisRow, ThisColumn, Across, Down)
✓
if Across:
✓
(1)
✓
AcrossList[a] = NextNumber
✓
a = a + 1
✓
if Down == True:
✓
DownList[d] = NextNumber
✓
d = d + 1
✓
if (Across == True) or (Down == True):
✓
Puzzle[ThisRow][ThisColumn] = NextNumber
✓
NextNumber = NextNumber + 1
✓
Mark Scheme
✓
Syllabus
✓
Paper
✓
Cambridge International AS/A Level – May/June 2016
✓
9691

Question 22

✓
Example Pascal:
✓
(1)
✓
NextNumber := 1;
✓
a := 1;
✓
d := 1;
✓
(1)
✓
FOR ThisRow := 1 TO 11 DO
✓
FOR ThisColumn := 1 TO 11 DO
✓
BEGIN
✓
(1)
✓
CheckStartOfWord(ThisRow, ThisColumn, Across, Down); (1)
✓
IF Across = TRUE
✓
THEN
✓
BEGIN
✓
AcrossList[a] := NextNumber;
✓
a := a + 1;
✓
END;
✓
IF Down = TRUE
✓
THEN
✓
BEGIN
✓
DownList[d] := NextNumber;
✓
d := d + 1;
✓
END;
✓
IF (Across = TRUE) OR (Down = TRUE)
✓
THEN
✓
BEGIN
✓
Puzzle[ThisRow, ThisColumn] := NextNumber;
✓
NextNumber := NextNumber + 1;
✓
END;
✓
END;
✓
Mark as follows:
  • 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
✓
Mark Scheme
✓
Syllabus
✓
Paper
✓
Cambridge International AS/A Level – May/June 2016
✓
9691

Question 22

Mark scheme 9691_s16_ms_22.pdf →

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 ........................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

..................................................................................................................................................................

.............................................................................................................................................................

[8]

Question 14

Topic relevance

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

Keep practising this topic