Matrix ( 2-Dimensional Array ) Exercises
  1. Create a project called MatrixTest and add a driver by the same name.
  2. 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.
  3. Have the driver instantiate a Matrix2D object, matrix, having 3 rows and 3 columns.
  4. Implement and test Matrix2D's toString() method that returns a 2D String representation of the matrix.
  5. Implement and test the Matrix2D method public void set(row,col, value) that assigns the element at (row,column) to value.
  6. Use the set method defined above to modify the elements of matrix to a known magic square.
  7. Implement and test the Matrix2D method, public boolean isMagicSquare(), that returns true if the argument is a magic square, false otherwise.
  8. Transpose the matrix. This requires that all the elements have their row and column locations interchanged.
  9. Reverse the order of the columns.
  10. Reverse the order of the rows.
  11. Find the sum of two matrices.
  12. Find the difference of two matrices.
  13. Find the product of two matrices.