Question: Write a method called create2DIntArray that creates a two-dimensional array of integers between 0 and 10. The array should have r rows and c columns.

Write a method called create2DIntArray that creates a two-dimensional array of integers between 0 and 10. The array should have r rows and c columns. Both r and c are passed to the method. The method should return the address of the array that it creates.

Write a method called print2DIntArray that nicely prints the contents of a two-dimensional array of integers. The address of the array should be passed to the method.

Write a method called sumOfRowIn2DIntArray that returns the sum of the values in row r in a two-dimensional where, r is passed to the method along with the address of the two-dimensional array.

Write a method called sumOfColumnIn2DIntArray that returns the sum of the values in column c in a two-dimensional, where c is passed to the method along with the address of the two-dimensional array.

Write a method called sumOfRightDiagonalIn2DIntArray that returns the sum of the values in the right-leaning diagonal in a two-dimensional. The address of the two-dimensional array will need to be passed to the method, of course.

Write a method called sumOfLeftDiagonalIn2DIntArray that returns the sum of the values in the left-leaning diagonal in a two-dimensional. The address of the two-dimensional array will need to be passed to the method, of course.

[Extra Credit] Write a method called sumOfNeighborsIn2DIntArray that returns the sum of the values that are next to the value in row r, column c. Both r and c are passed to the method along with the array of course.

In my java programming class, How would i go about doing this by just using arrays and loops

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!