Question Constellation Sign up for free
Q12.3 1 mark

AQA · GCSE · Computer Science · Higher · Paper 1A Computational thinking and programming skills (C#)

getTile(row, column) returns the tile value at a position on the 3 x 3 board; the blank space is represented by 0.

Figure 16
int ref1, ref2;
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
if (getTile(i, j) == 0)
{
ref1 = i;
ref2 = j;
}
}
}

Explain the purpose of the first iteration structure in the program in Figure 16.

Your answer