using System.Collections.Generic;
public Student(string firstName, string lastName, int age)
this.FirstName = firstName;
this.LastName = lastName;
public static void ExtractNamesBeforeSurnames(Student[] students)
var firstNameBeforeLast =
where student.FirstName[0] < student.LastName[0]
foreach (Student student in firstNameBeforeLast)
Console.WriteLine(student.FirstName + " " + student.LastName);
public static void FindStudentsInAgeGroup(Student[] students)
where (student.Age >= 18 && student.Age <= 24)
foreach (Student student in between18And24)
Console.WriteLine(student.FirstName + " " + student.LastName);
public static void Main()
Student[] array = new Student[]
new Student("Mark", "Marky", 16),
new Student("Daniel", "Wacko", 25),
new Student("Stan", "Masterson", 24),
new Student("Michell", "Qthilson", 18),
Student.FindStudentsInAgeGroup(array);