Exemple #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");
     }
 }
Exemple #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;
     }
 }
Exemple #3
0
 public TakenCourse(Course course, Student student, int grade)
 {
     this.course = course;
     this.student = student;
     this.grade = grade;
 }
Exemple #4
0
 public TakenCourse(Course course, Student student)
     : this(course, student, 0)
 {
 }
Exemple #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);
 }
Exemple #6
0
 public void AddCourse(Course c)
 {
     if (coursesTaught.Contains(c) == false)
         coursesTaught.Add(c);
 }