Question
Write a program that generates an nxm two dimensional array filled with random values. The dimensions should be on [0,10] and the values should be
Write a program that generates an nxm two dimensional array filled with random values. The
dimensions should be on [0,10] and the values should be on [0,9]. You will then print out the array
with the sum of the rows and the sum of the columns.
You will generate the dimensions of the two-dimensional array in the main. Random number
generation, two-dimensional array generation, and printing of two-dimensional array with sums should
all be in methods. This program will take no user input.
For instance for a 3x4 array, the output might look like:
3 6 5 2 : 16
1 4 2 6 : 13
9 3 5 0 : 17
-------------
13 13 12 8
HINT: Summing the rows is pretty straightfoward. Summing the columns can be done in a few different
ways. One involves looping through the two-dimensional array again and the other involves creating
another array that sums the columns as you sum the rows.
***CODE IN JAVA PLEASE***
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