Skip to content

Instantly share code, notes, and snippets.

@Sander-Kastelein
Last active January 20, 2016 11:46
Show Gist options
  • Save Sander-Kastelein/57740ca270e723994c74 to your computer and use it in GitHub Desktop.
Save Sander-Kastelein/57740ca270e723994c74 to your computer and use it in GitHub Desktop.
beter voorbeeld
static int getOnvoldoendesByStudent(Student student)
{
int onvoldoendeCount = 0;
foreach(Exam exam in exams)
{
if(exam.Student == student && exam.Score < 5.5m)
{
onvoldoendeCount++;
}
}
return onvoldoendeCount;
}
static string getWorstStudentName()
{
Student worstStudent = students.First();
foreach (Student student in students)
{
if(getOnvoldoendesByStudent(worstStudent) < getOnvoldoendesByStudent(student))
{
worstStudent = student;
}
}
return worstStudent.Name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment