How to write a program in java that ask the user to input an int size value into a 2d array, then output a table of random 0 and 1 of that size (table must be a perfect square), then output the...


How to write a program in java that ask the user to input an int size value into a 2d array, then output a table of random 0 and 1 of that size (table must be a perfect square), then output the fraction of your array that is ones and the fraction that is zeros, then output the sum for each row, the sum of colunms and which row and colunm have the largest sum, then determine if the largest row sum is greater than the largest column sum or vice versa, then output the sum of the diagonal(the diagonal starting at location [0][0] and going down to [N-1][N-1] for an array of size N) and determine if the diagonal sum is greater or equal to the largest row sum and greater than or equal to the largest column sum?


output should look similar to screen shot



enter the size of the array...<br>10100<br>11011<br>00101<br>11100<br>00101<br>fraction of ones =<br>13/25<br>fraction of zeros = 12/25<br>row 0 sum = 2<br>row 1 sum = 4<br>row 2 sum = 2<br>row 3 sum = 3<br>row 4 sum = 2<br>row 1 has the largest row sum!<br>col 0 sum = 3<br>col 1 sum<br>= 2<br>col 2 sum = 4<br>col 3 sum = 1<br>col 4 sum = 3<br>col 2 has the largest col sum!<br>columns win!<br>diagonal sum is 4<br>diagonals rule<br>

Extracted text: enter the size of the array... 10100 11011 00101 11100 00101 fraction of ones = 13/25 fraction of zeros = 12/25 row 0 sum = 2 row 1 sum = 4 row 2 sum = 2 row 3 sum = 3 row 4 sum = 2 row 1 has the largest row sum! col 0 sum = 3 col 1 sum = 2 col 2 sum = 4 col 3 sum = 1 col 4 sum = 3 col 2 has the largest col sum! columns win! diagonal sum is 4 diagonals rule

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here