Question
Create a java project called Lab13. Implement a MagicMatrix class with a two dimensional array (matrix) as a class level variable (attribute) and the necessary
Create a java project called Lab13. Implement a MagicMatrix class with a two dimensional array (matrix) as a class level variable (attribute) and the necessary methods. The constructor accepts a two dimensional array of int as its parameter and should throw an exception if the input matrix is not square (number of rows not equal to the number of columns). Also implement an EntryPoint class that constructs and initializes a MagicMatrix object and tests whether the matrix is semi-magic column wise, semi-magic row wise and/or fully magic. Required public methods in the Matrix class: // Description: only constructor for the class // Parameters: Two dimensional integer array // Throws: IllegalArguementException if matrix is not square. public MagicMatrix(int[][] matrix) // Description: Determines if a square matrix is row semi-magic // Parameters: // Assumptions: matrix is square // Returns: TRUE/FALSE whether the matrix attribute is row semi-magic public boolean SemiMagicRowWise() // Description: Determines if a square matrix is column semi-magic // Parameters: // Assumptions: matrix is square // Returns: TRUE/FALSE whether the matrix attribute is column semi-magic public boolean SemiMagicColumnWise() // Description: Determines if a square matrix is magic // Parameters: // Assumptions: matrix is square // Returns: TRUE/FALSE whether the matrix attribute is magic public boolean fullMagic() Optionally create any private helper methods you see fit and/or a toString() method that summarizes the levels of magicness (row, column, full) of the matrix. The lab will be turned in by creating a compressed folder from the project folder and uploading the completed file to your Sakai Drop Box by the assigned date/time.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started