- Create a project called MatrixTest and add a driver by the same name.
- Add the class Matrix2D that
encapsulates a two-dimensional, integer-valued array. Add a constructor that
accepts the number of rows and columns and initializes each of the elements
to a random single-digit integer.
- Have the driver instantiate a Matrix2D object, matrix,
having 3 rows and 3 columns.
- Implement and test Matrix2D's toString() method
that returns a 2D String representation of the matrix.
- Implement and test the Matrix2D method public
void set(row,col, value) that
assigns the element at (row,column) to value.
- Use the set method defined above to modify the elements of matrix to
a known magic square.
- Implement and test the Matrix2D method, public
boolean isMagicSquare(),
that returns true if
the argument is a magic
square, false otherwise.
- Transpose the matrix. This requires that all the elements have their row and column locations interchanged.
- Reverse the order of the columns.
- Reverse the order of the rows.
- Find the sum of two matrices.
- Find the difference of two matrices.
- Find the product of two matrices.