예제 #1
0
 private void PrintStudents(Dictionary <string, double> studentsSorted)
 {
     foreach (KeyValuePair <string, double> keyValuePair in studentsSorted)
     {
         OutputWriter.PrintStudent(keyValuePair);
     }
 }
예제 #2
0
 public static void GetStudentScoresFromCourse(string courseName, string userName)
 {
     if (IsQuerryForStudentsPossible(courseName, userName))
     {
         OutputWriter.PrintStudent(new KeyValuePair <string, List <int> >(userName, studentsByCourse[courseName][userName]));
     }
 }
예제 #3
0
 private static void PrintStudents(Dictionary <string, List <int> > studentsSorted)
 {
     foreach (KeyValuePair <string, List <int> > keyValuePair in studentsSorted)
     {
         OutputWriter.PrintStudent(keyValuePair);
     }
 }
 private void PrintStudents(Dictionary <string, double> dataSorted)
 {
     foreach (var student in dataSorted)
     {
         OutputWriter.PrintStudent(student);
     }
 }
예제 #5
0
 public void GetStudentScoresFromCourse(string courseName, string userName)
 {
     if (IsQuerryForStudentPossible(courseName, userName))
     {
         OutputWriter.PrintStudent(new KeyValuePair <string, double>(userName, courses[courseName].StudentsByName[userName].MarksByCourseName[courseName]));
     }
 }
예제 #6
0
        public static void GetAllStudentsFromCourse(string courseName)
        {
            if (IsQuerryForCoursePossible(courseName))
            {
                OutputWriter.WriteMessageOnNewLine($"{courseName}");

                foreach (var studentsMarksEntry in studentsByCourse[courseName])
                {
                    OutputWriter.PrintStudent(studentsMarksEntry);
                }
            }
        }
예제 #7
0
        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.PrintStudent(new KeyValuePair <string, double>(studentMark.Key, studentMark.Value));
                    counterForPrinted++;
                }
            }
        }
예제 #8
0
        private static void FilterAndTake(Dictionary <string, List <int> > wantedData, Predicate <double> givenFilter, int studentsToTake)
        {
            int counterForPrinted = 0;

            foreach (var userName_Points in wantedData)
            {
                if (counterForPrinted == studentsToTake)
                {
                    break;
                }
                //double averageMark = Average(userName_Points.Value);
                double averageScore             = userName_Points.Value.Average();
                double percentageOfFullfillment = averageScore / 100;
                double mark = percentageOfFullfillment * 4 + 2;
                if (givenFilter(mark))
                {
                    OutputWriter.PrintStudent(userName_Points);
                    counterForPrinted++;
                }
            }
        }