Question Constellation Sign up for free
Q12.6 4 marks

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

Table 4
SubroutinePurpose
getTile(row, column)Returns the number of the tile on the board in position (row, column).

The blank space on a board is represented by 0. Figure 18 and Figure 19 show example boards.

Figure 18
row \ column012
0520 (blank)
1134
2678
Figure 19
row \ column012
0234
1510 (blank)
2786

For the board in Figure 18, the program would display No. For the board in Figure 19, the program would display Yes.

Write a C# program to check that, in the first row, the second tile number is one more than the first and the third tile number is one more than the second. Display Yes when both conditions are met and No otherwise. You must use getTile. Use meaningful variable name(s) and C# syntax.

Your answer