Past-paper question · 2016 May-June · Paper 11 · Q8(c)

Question 8(c) 2016 · May-June · Paper 11 · 2 marks

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

Official answer for Question 8

Part (c)

Board[6, 4] = 1[2]

✓
Board[7, 5] = 2 ; 1 mark
✓
ROW 1 mark

Mark scheme 9691_s16_ms_11.pdf →

Show text version of question

Question 8

Part (c)

Question 8

Two players, X and O, play a game. The players take turns to place either ‘X’ or ‘O’ in any one of

the empty squares on the board. The board shows a current game in play.

1 2 3 4 5 6 7 1 X O 2 X 3 O

Question 4

5 O 6 X O O X 7 O X X X O

Either player (X or O) wins when there are four ‘X’s or four ‘O’s next to each other:

  • in a row, or
  • in a column, or
  • in a diagonal line
A
programmer is writing a computer program for the game.

The programmer stores the mark ‘X’ as the value 1 and the mark ‘O’ as the value 2.

The programmer uses a 2-dimensional array, Board[1 : 7, 1 : 7] , to store the current value in each square.

Part (c)

For the game shown above, show the values that are currently stored in the following array

elements. State whether the first index number is used for the row or column.

Board[6, 4] .........................................................................................................................

Board[7, 5] .........................................................................................................................

[2]

Question 13

Topic relevance

Why this question appears here

71% assigned-topic match · Data types and structures › Arrays

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

Keep practising this topic