Search for question
Question

4. Consider the following codes, which is intended to compute the mean of N integers

from standard input.

public dass Mean

{

public static void main(String[] args)

{

/* your code for question 1 shou d go her e*/

Scanner scan1 = new Scanner(Syst emi n);

irt[] a = newirt[N];

fa(int i = Qi < Ni++)

a[i] = scan1 next rt();

/* your code for question 2 shou d go her e*/

}

}

Add the needed code so that:

1. N is a random number between 10 and 20

2. The program produces the mean of the N integers, rounded to the nearest

integer.

Fig: 1