private void PrintStudents(Dictionary <string, double> studentsSorted)
 {
     foreach (KeyValuePair <string, double> keyValuePair in studentsSorted)
     {
         OutputWriter.DisplayStudent(keyValuePair);
     }
 }
Example #2
0
 public void GetStudentScoreFromCourse(string courseName, string studentName)
 {
     if (this.IsQueryForStudentPossible(courseName, studentName))
     {
         OutputWriter.DisplayStudent(new KeyValuePair <string, double>(studentName, this.courses[courseName].StudentsByName[studentName].MarksByCourseName[courseName]));
     }
 }
        private void FilterAndTake(Dictionary <string, double> studentsWithMarks, Predicate <double> givenFilter,
                                   int studentsToTake)
        {
            int counterForPrinted = 0;

            foreach (var studentMark in studentsWithMarks)
            {
                if (counterForPrinted == studentsToTake)
                {
                    break;
                }

                if (givenFilter(studentMark.Value))
                {
                    OutputWriter.DisplayStudent(new KeyValuePair <string, double>(studentMark.Key, studentMark.Value));
                    counterForPrinted++;
                }
            }
        }