private void PrintStudents(Dictionary <string, double> sortedStudents) { foreach (var item in sortedStudents) { StudentsRepository studentsRepository = new StudentsRepository(new RepositoryFilter(), new RepositorySorters()); studentsRepository.PrintStudent(item); } }
private void FilterAndTake(Dictionary <string, double> sudentsWithMarks, Predicate <double> givenFilter, int studentsToTake) { int counterForPrinted = 0; foreach (var userName_Points in sudentsWithMarks) { if (counterForPrinted == studentsToTake) { break; } if (givenFilter(userName_Points.Value)) { StudentsRepository studentsRepository = new StudentsRepository(new RepositoryFilter(), new RepositorySorters()); studentsRepository.PrintStudent(userName_Points); counterForPrinted++; } } }