Пример #1
0
 public void ChangeGrade(Course c, int grade)
 {
     TakenCourse toChange = courses.Find(tc => tc.Course.Equals(c));
     if (toChange != null) {
         toChange.Grade = grade;
     } else {
         throw new ArgumentException("Can't change non existing grade");
     }
 }
Пример #2
0
 public bool AddCourse(Course c, int grade)
 {
     TakenCourse newCourse = new TakenCourse(c, this, grade);
     if (courses.Contains(newCourse) == false) {
         courses.Add(newCourse);
         return true;
     } else {
         return false;
     }
 }
Пример #3
0
 public TakenCourse(Course course, Student student, int grade)
 {
     this.course = course;
     this.student = student;
     this.grade = grade;
 }
Пример #4
0
 public TakenCourse(Course course, Student student)
     : this(course, student, 0)
 {
 }
Пример #5
0
 /// <summary>
 /// Adds a course with default grade to the
 /// list of courses the student has passed
 /// </summary>
 /// <param name="c">The course to add</param>
 /// <returns>true if the course is added, false otherwise</returns>
 public bool AddCourse(Course c)
 {
     return AddCourse(c, 0);
 }
Пример #6
0
 public void AddCourse(Course c)
 {
     if (coursesTaught.Contains(c) == false)
         coursesTaught.Add(c);
 }