Past-paper question · 2015 May-June · Paper 22 · Q3(a)(iii)

Question 3(a)(iii) 2015 · May-June · Paper 22 · 7 marks

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

Official answer for Question 3

Part (a)

(iii)

(iii)

Mark as follows:

✓
Correct identifier
✓
Correct dimensions
✓
Correct data type in declaration (Correct for initial value used below)
✓
Correct outer loop
✓
Correct inner loop
✓
Correct indices for assignment (LH)
✓
Assign initial value within loop (RH) if not a valid initial value
✓
Example Pascal
✓
VAR Grid : ARRAY [1..3, 1..3] OF CHAR;
✓
FOR Row := 1 TO 3 DO
✓
FOR Column := 1 TO 3 DO
✓
Grid[Row, Column] := NULL;
[7]

Mark scheme 9691_s15_ms_22.pdf →

Show text version of question

Question 3

Part (a)

(iii)

Question 3

A board game is designed for two players, O and X.

At the beginning, all cells of a 3 x 3 grid are empty.

The players take turns in placing their marker in an empty cell of the grid; player O always starts.

The game ends when one player completes a row, column or diagonal or the grid is full.

Here is one example after three turns:

O

O X

Ali wants to write a program to play the game. The array Grid is to be used to represent the contents of the grid.

Rows and columns are to be numbered from 1 to 3.

(iii)

In a high-level programming language, write statements to:

  • declare the array Grid
  • assign the value for an empty cell to all cells

Programming language .....................................................................................................

Code ..................................................................................................................................

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

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

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

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

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

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

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

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

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

[7]

Question 6

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

Keep practising this topic