Esempio n. 1
0
 private void PrintStudents(Dictionary <string, double> studentsSorted)
 {
     foreach (KeyValuePair <string, double> keyValuePair in studentsSorted)
     {
         OutputWriter.PrintStudent(keyValuePair);
     }
 }
Esempio n. 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]));
     }
 }
Esempio n. 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);
     }
 }
Esempio n. 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]));
     }
 }
Esempio n. 6
0
        public static void GetAllStudentsFromCourse(string courseName)
        {
            if (IsQuerryForCoursePossible(courseName))
            {
                OutputWriter.WriteMessageOnNewLine($"{courseName}");

                foreach (var studentsMarksEntry in studentsByCourse[courseName])
                {
                    OutputWriter.PrintStudent(studentsMarksEntry);
                }
            }
        }
Esempio n. 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++;
                }
            }
        }
Esempio n. 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++;
                }
            }
        }