using System.Collections.Generic;
public Student(string fName, string lName, List<double> marks)
public string FirstName {get;set;}
public string LastName {get;set;}
public List<double> Marks {get;set;}
public class CategorizeNumbers
public static void Main()
var students = new List<Student>
new Student("Richard1", "Edwards1",new List<double> {5, 2, 5, 4}),
new Student("Richard2", "Edwards2",new List<double> {5, 2, 5, 4}),
new Student("Richard3", "Edwards3",new List<double> {5, 6, 5, 4}),
new Student("Richard4", "Edwards4",new List<double> {5, 2, 5, 4}),
new Student("Richard5", "Edwards5",new List<double> {5, 2, 6, 4}),
var excellentStudents = students
.Select(s => new { FullName = s.FirstName + " " + s.LastName, Marks = s.Marks })
.Where(s => s.Marks.IndexOf(6) >= 0);
foreach (var student in excellentStudents)
Console.WriteLine("Name:{0} Marks:{1}",student.FullName,string.Join(", ", student.Marks));