public static void Main()
int[] list = new int[10];
for(int i = 0; i<10; i++)
list[i] = r.Next(1, 101);
Console.Write(list[i] + " ");
Console.Write("\n Your numbers in order from least to greatest are: ");
foreach(int number in list)
{Console.Write(number + " ");}
Console.WriteLine("\n The average of your list of numbers is: " +list.Average());
Console.WriteLine("The median of your list of numbers is: " +Median(list));
Console.WriteLine("If you would like a new list of numbers and to run the program again, enter Y/N.");
string choice1 = Console.ReadLine();
if (choice1 == "Y" || choice1 == "y")
Console.WriteLine("Ok, have a good day!");
static private float Median(int[] array)
int count = tempArray.Length;
float middleElement1 = tempArray[(count / 2) - 1];
float middleElement2 = tempArray[(count / 2)];
medianValue = (middleElement1 + middleElement2) / 2;
medianValue = tempArray[(count / 2)];