void topAverage() { decimal top = 0; foreach (object obj in lbStudents.Items) { Student student = obj as Student; if (student.Average() > top) { top = student.Average(); } } tbTopAverage.Text = string.Format("{0:0.00}", top); }
void fillCourses(Student student) { lbDosier.Items.Clear(); foreach (Course course in student.Courses) { lbDosier.Items.Add(course); } tbAverage.Text = string.Format("{0:0.00}", student.Average()); }