Page 394 - AP Computer Science A, 7th edition
P. 394

(D) Reflects mat through a vertical line of symmetry. For example,
(E) Leaves mat unchanged.
32. Consider a class MatrixStuff that has a private instance variable:
private int[][] mat;
Refer to method alter below that occurs in the MatrixStuff class. (The lines are numbered for reference.)
 1:
Line
/∗∗ @param mat the matrix initialized with integers
Line 2:
Line 3:
Line 4:
Line
5:
Line 6:
Line 7:
Line 8:
Line 9:
∗ ∗
∗ ∗
∗/
public void alter(int[][] mat, int c)
{
@param c the column to be removed
Post c ondit ion:
– Column c has been removed.
– The last column is filled with zeros.
for (int i = 0; i < mat.length; i++)








































































   392   393   394   395   396