public static void GetStudentsScoresFromCourse(string courseName, string userName)
 {
     if (IsQueryForStudentPossible(courseName, userName))
     {
         OutputWriter.PrintStudent(new KeyValuePair <string, List <int> > (userName, studentsByCourse[courseName][userName]));
     }
 }
 private static void PrintStudent(Dictionary <string, List <int> > studentsSorted)
 {
     foreach (var kvp in studentsSorted)
     {
         OutputWriter.PrintStudent(kvp);
     }
 }
示例#3
0
 private static void PrintStudents(Dictionary <string, List <int> > studentsSorted)
 {
     foreach (var keyValuePair in studentsSorted)
     {
         OutputWriter.PrintStudent(keyValuePair);
     }
     {
     }
 }
 public static void GetAllStudentcFromCourse(string courseName)
 {
     if (IsQueryForCoursePossible(courseName))
     {
         OutputWriter.WriteMessageOnNewLine($"{courseName}:");
         foreach (var studentMarksEntry in studentsByCourse[courseName])
         {
             OutputWriter.PrintStudent(studentMarksEntry);
         }
     }
 }
        private static void FilterAndTake(Dictionary <string, List <int> > wantedData, Predicate <double> givenFilter, int studentsToTake)
        {
            int counterForPrinted = 0;

            foreach (var username in wantedData)
            {
                if (counterForPrinted == studentsToTake)
                {
                    break;
                }
                double averageScore            = username.Value.Average();
                double percentageOfFullfilment = averageScore / 100;
                double mark = percentageOfFullfilment * 4 + 2;

                if (givenFilter(mark))
                {
                    OutputWriter.PrintStudent(username);
                    counterForPrinted++;
                }
            }
        }