Question: java programming Write a method called sumEven that take a two-dimension array of integers as a parameter and returns the sum of the even numbers.

java programming

java programming Write a method called sumEven that take a two-dimension array

Write a method called sumEven that take a two-dimension array of integers as a parameter and returns the sum of the even numbers. For example, if the array (as created by the program below) is 8 10 45 3 2 42 3 21 44 The value returned would be 106 (10+8+2+42+44). public class Question2 { public static void main(String args[]) { int arr[][] {{10, 45, 3, 8}, {2, 42}, {3, 21, 44}}; System.out.println("The sum of the even numbers is "+ sumEven (arr)); } //main public static int sumEven (int[][] myArray) {

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!