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
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