Please send file in ZIP format
4. Calculate the Median
Create an application that does the following:
1. Generates an array of randomly generated integers between 1 and 100. The
length of the array should also be randomly generated as an integer between 5
and 10.
2. Sorts the array in ascending order.
3. Calculates and displays the median value, which is mathematically defined as
the midpoint value. If the array has an odd number of values such as {2, 20, 35,
106, 117), the median is the single integer in the middle (35). If the array has an
even number of values, the median is the average of the two center values. For
example, in the array {2, 20, 35, 37, 106, 117}, the median is (35 + 37)/ 2.0 =
36.0. Hint: be sure to declare the median variable as type Double. An example
is shown in Figure 8-49, in which the array contains an even number of values.
4. Let the user generate the array and calculate the median by clicking a single button.
5. Display the median in a Label control.
Figure 8-49 Calculating the Median value
Calculate the Median
X
Randomly generated integer array
35,44,58,73,85,92,96
Calculate
Median value
73.00