static private float Median(float[]array)
float [] tempArray = array;
int count = tempArray.Length;
float varibale3 = tempArray[(count / 2)-1];
float varibale2 = tempArray[(count / 2)];
medianValue = (varibale3 + varibale2)/2;
medianValue = tempArray[(count/2)];
public static void Main()
Console.WriteLine("How many grades do you want to enter?");
int n = int.Parse(Console.ReadLine());
float [ ] grades = new float [n];
for (int i = 0; i < n;i++)
Console.WriteLine("Please enter value number " + (i+1));
grades [i] = float.Parse(Console.ReadLine());
Console.WriteLine("The grades seen from smallest to largest are:");
foreach(float person in grades)
Console.Write(person+ " " );
Console.WriteLine("Of the grades you inputed the average is " + grades.Average());
float average = grades.Average();
Console.WriteLine("Of the grades you inputed the median is : " + Median(grades));
Console.WriteLine("YOu are not passing see me for extra help.");
Console.WriteLine("You are passing good job");
Console.WriteLine("Would you like to run the program again? y/n");
string cool = Console.ReadLine();
if (cool == "y" || cool == "Y")
else if (cool == "n" || cool == "N")