Write an application that uses two-dimensional arrays, parallel one-dimensional arrays, and ArrayLists to find the largest rows and columns. Your application will randomly fill an n x n matrix with 0s and 1s. Then, using two one-dimensional ararys and two ArrayLists (one of each for rows, one of each for columns), count the number of 1s. Lastly, output the row and column numbers with the most 1s.

Rules
• You must get the value of n from the user.

• You must store the counts of the number of 1s (or sums) for the rows and columns in one-dimensional arrays that are parallel to the two-dimensional array

• You must use ArrayLists to keep track of the rows and columns with the most 1s

Solved
Show answers

Ask an AI advisor a question