Пример #1
0
        public void AddStudent(int grade, Student student)
        {
            Classroom classroomFound = null;

            foreach (var classroom in _classes)
            {
                if (classroom.Grade == grade)
                {
                    classroomFound = classroom;
                    break;
                }
            }

            if (classroomFound == null)
            {
                classroomFound = new Classroom(grade);
                _classes.Add(classroomFound);
            }

            classroomFound.AddStudent(student);
        }
Пример #2
0
 public void RegisterForAttendance(Classroom c)
 {
     AttendedClassroom = c;
 }
Пример #3
0
 public void AddClass(Classroom c)
 {
     _classes.Add(c);
 }