Question: write a java code that: 1- Ask user to enter an int value 2- Create a two dimensional array of that size. For example, if
write a java code that:
1- Ask user to enter an int value
2- Create a two dimensional array of that size. For example, if the user types in 6, then you are to create a 6 by 6 array.
3-Using a random object, set each element of your array to be either zero or one
4- Go through all the rows of your array and output the index of the row or rows that have the most ones.
Output should be like:
Enter an integer:
5
01010
01110
11100
00111
00001
the most ones are found in rows:
1
2
3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
