Arrays 2
Write a program called ArraysExercise2 that contains a main method.
- Write a method called statistics() that declares and initialises an array as follows:
int arr1[] = {9, 3, 44, 17, 15};
Write methods to calculate the average values of the array, the median value of the array and the range of the array.
Declare and initialise another array.
ìnt arr2[] = {8, -6, 89, 17, 12, 6};
Calculate the average,median and range for array2.
The average is 17.6
Median value is 15.0
range == 41
The average is 21.0
Median value is 21.0
Median value is 10.0
The median value is : 10.0
range == 95