private void PrintStudents(Dictionary <string, double> studentsSorted) { foreach (var kvp in studentsSorted) { OutputWriter.PrintStudent(kvp); } }
public void GetStudentScoresFromCourse(string student, string course) { if (IsQueryForStudentPossible(course, student)) { OutputWriter.PrintStudent(new KeyValuePair <string, double>(student, this.courses[course].StudentsByName[student].MarksByCourseName[course])); } }
public static void PrintStudents(Dictionary <string, double> studentsSorted) { foreach (var kv in studentsSorted) { OutputWriter.PrintStudent(kv); } }
public void PrintStudent(Dictionary <string, double> studentsSorted) { foreach (var pair in studentsSorted) { OutputWriter.PrintStudent(pair); } }
public void GetStudentMarkInCourse(string courseName, string username) { if (IsQueryForStudentPossible(courseName, username)) { OutputWriter.PrintStudent(new KeyValuePair <string, double>(username, this.courses[courseName].StudentsByName[username].MarksByCourseName[courseName])); } }
public static void GetStudentScoresFromCourse(string courseName, string userName) { if (IsQueryForStudentPossiblе(courseName, userName)) { OutputWriter.PrintStudent(new KeyValuePair <string, List <int> >(userName, studentsByCourse[courseName][userName])); } }
private static void PrintStudents(Dictionary <string, List <int> > studentsSorted) { foreach (var kvp in studentsSorted) { OutputWriter.PrintStudent(kvp); } }
private static void PrintStudents(Dictionary <string, List <int> > studentsSorted) { foreach (KeyValuePair <string, List <int> > keyValuePair in studentsSorted) { OutputWriter.PrintStudent(keyValuePair); } }
public static void PrintStudent(Dictionary <string, List <int> > studentsSorted) { foreach (var pair in studentsSorted) { OutputWriter.PrintStudent(pair); } }
public static void GetStudentScoresFromCourse(string courseName, string username) { if (studentsByCourse.ContainsKey(courseName) && studentsByCourse[courseName].ContainsKey(username)) { OutputWriter.PrintStudent(new KeyValuePair <string, List <int> >(username, studentsByCourse[courseName][username])); } }
private void PrintStudents(Dictionary <string, double> studentsSorted) { foreach (KeyValuePair <string, double> keyValuePair in studentsSorted) { OutputWriter.PrintStudent(keyValuePair); } }
public static void GetStudentScoresFromCourse(string course, string student) { if (IsQueryForStudentPossible(course, student)) { OutputWriter.PrintStudent(new KeyValuePair <string, List <int> >(student, studentsByCourse[course][student])); } }
private void PrintStudents(Dictionary <string, double> sortedStudents) { foreach (var student in sortedStudents) { OutputWriter.PrintStudent(student); } }
public void GetStudentScoresFromCourse(string courseName, string username) { OutputWriter.PrintStudent( new KeyValuePair <string, double>(username, this.courses[courseName] .StudentsByName[username] .MarksByCourseName[courseName])); }
private static void OrderAndTake(Dictionary <string, List <int> > wantedData, int studentsToTake, Func <KeyValuePair <string, List <int> >, KeyValuePair <string, List <int> >, int> comparisonFunc) { Dictionary <string, List <int> > studentsSorted = GetSortedStudents(wantedData, studentsToTake, comparisonFunc); foreach (var stud in studentsSorted) { OutputWriter.PrintStudent(stud); } }
private void PrintStudents(Dictionary <string, double> studentsWithMarks) { var counterForPrinted = 0; foreach (var student in studentsWithMarks) { OutputWriter.PrintStudent(new KeyValuePair <string, double>(student.Key, student.Value)); counterForPrinted++; } }
public static void GetAllStudentFromCourse(string courseName) { if (isQueryForCoursePossible(courseName)) { OutputWriter.WriteMessegesOnNewLine($"{courseName}"); foreach (var item in studentsByCourse[courseName]) { OutputWriter.PrintStudent(item); } } }
public static void GetAllStudentsFromCourse(string courseName) { if (IsQueryForCoursePossible(courseName)) { OutputWriter.WriteMessageOnNewLine($"{courseName}:"); foreach (var studentMarksEntry in studentsByCourse[courseName]) { OutputWriter.PrintStudent(studentMarksEntry); } } }
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++; } } }
private void FilterAndTake(Dictionary <string, double> studentsWithGrades, Predicate <double> givenFilter, int studentsToTake) { var printedStudents = 0; foreach (var student in studentsWithGrades) { if (printedStudents == studentsToTake) { break; } if (givenFilter(student.Value)) { OutputWriter.PrintStudent(new KeyValuePair <string, double>(student.Key, student.Value)); printedStudents++; } } }
private void FilterAndTake(Dictionary <string, double> studentsWithMarks, Predicate <double> givenFilter, int studentsToTake) { int counter = 0; foreach (var username_score in studentsWithMarks) { if (counter == studentsToTake) { break; } if (givenFilter(username_score.Value)) { OutputWriter.PrintStudent(username_score); counter++; } } }
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 averageScore = userName_Points.Value.Average(); double percentageOfFullfillments = averageScore / 100; double mark = percentageOfFullfillments * 4 + 2; if (givenFilter(mark)) { OutputWriter.PrintStudent(userName_Points); counterForPrinted++; } } }
private static void FilterAndTake(Dictionary <string, List <int> > wantedData, Predicate <double> givenFilter, int studentsToTake) { int counterForPrinted = 0; foreach (var usernamePoints in wantedData) { if (counterForPrinted == studentsToTake) { break; } double averageMark = Average(usernamePoints.Value); if (givenFilter(averageMark)) { OutputWriter.PrintStudent(usernamePoints); counterForPrinted++; } } }
public static void FilterAndTake(Dictionary <string, List <int> > wantedData, Predicate <double> givenFilter, int studentsToTake) { int counterForPrinted = 0; foreach (var usernamePoint in wantedData) { if (counterForPrinted == studentsToTake) { break; } double averageMark = usernamePoint.Value.Average(); double percentage = averageMark / 100; double mark = percentage * 4 + 2; if (givenFilter(mark)) { OutputWriter.PrintStudent(usernamePoint); counterForPrinted++; } } }
private static void FilterAndTake(Dictionary <string, List <int> > wantedData, Predicate <double> givenFilter, int studentsToTake) { int counter = 0; foreach (var username_score in wantedData) { if (counter == studentsToTake) { break; } var avrScore = username_score.Value.Average(); var percentageOfFullfillments = avrScore / 100; var mark = percentageOfFullfillments * 4 + 2; if (givenFilter(mark)) { OutputWriter.PrintStudent(username_score); counter++; } } }
private static void FilterAndTake(Dictionary <string, List <int> > wantedData, Predicate <double> givenFilter, int studentsToTake) { int filteredMarksCount = 0; foreach (KeyValuePair <string, List <int> > usernamePoints in wantedData) { if (filteredMarksCount == studentsToTake) { break; } double averageMark = usernamePoints.Value.Average(); double percentOfTotal = averageMark / 100; double mark = percentOfTotal * 4 + 2; if (givenFilter(mark)) { OutputWriter.PrintStudent(usernamePoints); filteredMarksCount++; } } }
/// <summary> /// Method which will actually do the filtration /// </summary> /// <param name="wantedData">Dictionary that corresponds to the students with their scores from the seeked course.</param> /// <param name="givenFilter">Filter to use.</param> /// <param name="studentsToTake">The number of students to take.</param> private static void FilterAndTake(Dictionary <string, List <int> > wantedData, Predicate <double> givenFilter, int studentsToTake) { int counterForPrinted = 0; foreach (var userMarksKVP in wantedData) { double averageScore = userMarksKVP.Value.Average(); var percentageOfAll = averageScore / 100; var mark = percentageOfAll * 4 + 2; if (givenFilter(mark)) { OutputWriter.PrintStudent(userMarksKVP); counterForPrinted++; } if (counterForPrinted == studentsToTake) { break; } } }