Computer Science · Oct / Nov 2025 · Paper 1 HL · Question 15
Adapt for 2027Processing a 2D array with nested loops is B2.2.2 and B2.3, but the algorithms must be written in Python or Java instead of pseudocode.
IBCS
As printed in the paper
The question as text
15. A two-dimensional array is also known as a matrix. A square matrix is a matrix with the same number of rows and columns. Figure 1: Example data stored in four square matrices: AMAT, BMAT, CMAT, and DMAT AMAT BMAT [0] [1] [2] [3] [4] [0] [1] [2] [3] [0] 2 4 1 4 5 [0] 1 0 0 0 [1] 0 5 7 0 6 [1] 3 6 0 0 [2] 0 0 3 2 2 [2] 4 0 7 0 [3] 0 0 0 2 3 [3] 0 3 2 0 [4] 0 0 0 0 9 CMAT DMAT [0] [1] [2] [0] [1] [2] [3] [0] 2 0 0 [0] 1 5 0 0 [1] 0 5 0 [1] 3 6 9 0 [2] 0 0 3 [2] 4 0 7 1 [3] 0 3 2 0 The main diagonal is the set of elements that run from the upper left-hand corner of the matrix to the lower right-hand corner of the matrix.
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
15(a)[1]
15(b)[2]
15(c)[7]
15(d)[5]
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

