//100, 85, 97, 61, 55, 89 public static IEnumerable <int> CheckGrades(List <int> grades, IntToBoolFunction gradesToCheck) { foreach (int grade in grades) { if (gradesToCheck(grade)) //gradesToCheck = GreaterThanSeventy(grade) { yield return(grade); } } }
//"the", "bike", "this", "it", "tenth","mathematics" public static IEnumerable <string> HasTwoLetters(List <string> names, IntToBoolFunction wordsToCheck) { foreach (string word in names) { if (wordsToCheck(word)) { yield return(word); } } }