How to get Median/Middle value in an array?

So first of all we use textpad in our java course (idk why) and the Easy.In method for our input.

anyway I have this assignment and we're ask to make a program that input 1) how many numbers were input 2) the largest value 3)smallest value 4) average value and 5) middle/median value. I manage to figure out the code for the other except the median value. So i'm here asking for help!

here's my code

Code Java:

class project2
{
public static void main(String[] args)
{
System.out.println("How many numbers you want to input");
int maxItems = EasyIn.getInt();
int[] numbers = new int[maxItems];
for(int i = 0; i < maxItems; i++)
{
System.out.println("Enter the value of number " + (i+1));
numbers[i] = EasyIn.getInt();
}
System.out.println("The total count of numbers you inputed is " +maxItems);
findlargest(numbers);
findsmallest(numbers);
findaverage(numbers);
findmiddle(numbers);
}
public static void findlargest(int[]nos)
{
int largest = 0;
for(int i = 0; i < nos.length; i++)
{
if(nos[i] > largest)
largest = nos[i];
}
System.out.println(" ");
System.out.println("The largest value is " +largest);
}
public static void findsmallest(int[]nos)
{
int smallest = nos[0];
for(int i = 0; i < nos.length; i++)
{
if(nos[i] < smallest)
smallest = nos[i];
}
System.out.println(" ");
System.out.println("The smallest value is " +smallest);
}
public static void findaverage(int[]nos)
{
double total = 0;
double average;
for(int i = 0; i < nos.length; i++)
{
total += nos[i];
}
average = total / nos.length;
System.out.println(" ");
System.out.println("The average value is " +average);
}
public static void findmiddle(int[]nos)
{
}
}

Re: How to get Median/Middle value in an array?

Please post your code correctly.

When I greeted you in January, I didn't ask you to read this topic to learn how to post code in code or highlight tags and other useful info for new members.