Given an input of a 2D array of integers, input the integers and calculate the average of the top half and the bottom half of the array. The first line of the input will consist of two integers N and M, denoting the number of rows and columns of the array respectively. The next N lines will contain M integers separated by space. Your program should read these integers in, store them in a 2D array, and then calculate the average of the numbers stored in the first N / 2 rows, then calculate the average of the numbers stored in the last N / 2 rows. N will be even. Output both of these averages.

Please reply to this post with your solution.

I might not get into the zoom meeting. Because last time my zoom didnâ€™t work.

public class Main { public static void main(String[] args) { int N = 100; boolean[] isPrime = new boolean[N + 1]; for (int i = 2; i <= N; i++) { isPrime[i] = true; } for (int i = 2; i*i <= N; i++) { if (isPrime[i]) { for (int j = i; i*j <= N; j++) { isPrime[i*j] = false; } } } // count primes int primes = 0; for (int i = 2; i <= N; i++) { if (isPrime[i]) primes++; } System.out.println( "The number of primes <= " + N + " is " + primes); } }