Answered You can buy a ready-made answer or pick a professional tutor to order an original one.

QUESTION

In this assignment, it is required to write a java class, Arrays2DTest, in which you have to create the following methods:• public static int max(int[][] a)that returns the maximum value in the 2d p

In this assignment, it is required to write a java class, Arrays2DTest, in which you have to create the following methods:

• public static int max(int[][] a)that returns the maximum value in the 2d parameter array a.

• public static int rowSum(int[][] a, int x)that returns the sum of the elements in Row x of a.

• public static int columnSum(int[][] a, int x)that returns the sum of the elements in Column x of a (careful with rows of different lengths!).

• public static int[] allRowSums(int[][] a)that calculates the row sum for every row and returns each of the values in an array. Index i of the return array contains the sum of elements in row i.

• public static boolean isRowMagic(int[][] a)that checks if the array is row-magic (this means that every row has the same row sum).

• public static boolean isColumnMagic(int[][] a)that checks if the array is column-magic (this means that every column has the same column sum).

• public static boolean isSquare(int[][] a)that checks if the array is square (i.e. every row has the same length as a itself).

• public static boolean isMagic(int[][] a)that checks if the array is a magic square. This means that it must be square, and that all row sums, all column sums, and the two diagonal-sums must all be equal.

• A main method, in which you do the following:a) Create one or two 2D arrays of integers.b) Invoke the previous methods to print out the sum per row and per column, and to find out if the array is magic.

Show more
  • @
  • 22 orders completed
ANSWER

Tutor has posted answer for $15.00. See answer's preview

$15.00

**** ** the ****** below ***** **** Attached<< Test ***** ******* ****** ********* 1 ** * * 81 1 2Maximum ******* ** ***** * **** ** *** * **** ** *** 1 * ***** of *** * * **** of ****** : **** ** ****** * * 5Sum of ****** * * **** ** ****** 3 : *** ***** *** ***** : ******* ***** ****** ***** * falseIs ***** ****** : falseIs Array ****** ***** : ************* **** ***** **** ****** >>1 * 11 1 ** * 1Maximum Element ** ***** * **** of Row : **** ** *** 1 * 3Sum of *** * : **** ** ****** * **** ** Column * : 3Sum ** ****** * * 3Is ***** Row ***** * ****** Array ****** ***** * trueIs ***** ****** * ****** Array ***** ****** * ****

Click here to download attached files: Arrays2DTest.txt
or Buy custom answer
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question