Question: in java Write a function, getBordersSum(), that takes a 2-dimensional array of integers, row size, and column size as parameters. The function should calculate and

 in java Write a function, getBordersSum(), that takes a 2-dimensional array

in java

Write a function, getBordersSum(), that takes a 2-dimensional array of integers, row size, and column size as parameters. The function should calculate and return the sum of all integers around the borders of the array as shown in the example below: If the array size is 5x4 and contains the following numbers: Then, the function should sum all the numbers around the array borders (see highlighted cells) and return the sum. In this example, the sum =2+1+0+7+1+4+3+6+7+10+1+8+6+5=61

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!