Java HandWritten Matrix LabCreate a class IntMatrix with:con
Java HandWritten Matrix LabCreate a class IntMatrix with:constructor with parameters for #rows, #colsset method to set a single cell (three params). Print out an error if row or column is invalid.numCols and numRows methods that return #rows and #cols.sum method that returns sum of all cells in matrix.rowSum method that returns the sum of a particular row in the matrixmin method that returns the minimum of all cells.toString that prints out as a matrix (rows and cols)equals methodextra credit: addRows and addCols methods that dynamically resize the matrix.Provide a main that tests all methods, see example below:IntMatrix matrix = new IntMatrix(2,3);matrix.set(0,0,99);matrix.set(1,1,88);matrix.set(5,3,77); // should print out errorSystem.out.println(‘matrix is: ‘+matrix);System.out.println(‘matrix numRows is’+matrix.numRows());System.out.println(‘matrix sum is’+matrix.sum());System.out.println(‘matrix sum of 2nd row is’+matrix.rowSum(1));System.out.println(‘matrix min is’+matrix.min());IntMatrix matrix2= new IntMatrix(2,3);matrix2.set(0,0,99);matrix2.set(1,1,88);IntMatrix matrix3= new IntMatrix(2,3);matrix3.set(0,0,44);matrix3.set(0,1,22);if (matrix.equals(matrix2)) System.out.println(‘matrix equals matrix2’); // should printif (matrix.equals(matrix3)) System.out.println(‘matrix equals matrix3’); // should not print
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
