Ejemplo n.º 1
0
 //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);
         }
     }
 }
Ejemplo n.º 2
0
 //"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);
         }
     }
 }