public static void Main()
Console.WriteLine("How many people are in your class? ");
string input = Console.ReadLine();
if (int.TryParse(input, out classSize))
string[] students = new string[classSize];
for (int i = 0; i < classSize; i++)
Console.WriteLine("Please enter person " + (i + 1));
students[i] = Console.ReadLine();
Console.WriteLine("The people in your class in alphabetical order are: ");
foreach (string name in students)
Console.Write(name + " ");
Console.WriteLine("Your input was invalid. Please enter the correct integer.");