ExamBank Scot · AH Computing Science question bank · All AH Computing Science questions

AH Computing Science 2023 Question 1

1 mark · 2-D arrays

A new game is being developed. When the game is being played, details of the black and white tiles will be stored in a 2‑D array of character values as shown below. game display B B B B B B B B B B B B B B B B B B B B B B B B B B W B B W W B W W W W W B B B B W W W B W W B B W W W W B W W B W W W B W W W B W W W B W W W B B W B B W W W W W W W W W B W W B W W W W B W matching contents of the 2-D array Using a programming language of your choice, declare a 2‑D array called gameBoard capable of storing this grid.

Marking scheme

DECLARE gameBoard AS ARRAY OF ARRAY OF CHARACTER INITIALLY < 12 x 8 > Award 1 mark for 2D character array with correct dimensions. Accept string array. Accept dimensions 11 x 7. Accept 8x12 and 7x11 if correct data type indicated.

Previous question: AH Computing Science 2022 Question 11

Next question: AH Computing Science 2023 Question 2