Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write this in java. there's already a copy of this assignment here that someone did and I have it. I do not want to
Please write this in java. there's already a copy of this assignment here that someone did and I have it. I do not want to use it because there are lots of errors and few of my classmates are using it. so please do not copy and paste it. please write my code from scratch. Also please include the word for word instructions on how the code works and how it meets the assignment requirements.
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 Os 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 Here are a few sample runs (user input in bold): Sample 1 Enter the array size: 4 = 1 1 1 1 1010 0001 0000 The largest row is: [0] The largest column is: (0, 2, 3] Sample 2 Enter the array size: 72 0 1 1 0 1 0 1 1 100 101 0000100 0000101 1010000 0000111 0001000 The largest row is: [0, 1] The largest column is: [4]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