示例#1
1
        public static void Main()
        {
            SchoolClass physics = new SchoolClass("physics");

            Teacher pesho = new Teacher("Pesho");
            physics.AddTeacher(pesho);

            Teacher gosho = new Teacher("Gosho");
            physics.AddTeacher(gosho);

            Teacher tosho = new Teacher("Tosho");
            physics.AddTeacher(tosho);
            tosho.AddComment("I am a comment");

            Student ivan = new Student("Vanko", "009");
            physics.Students.Add(ivan);

            Student petko = new Student("Pecata", "003");
            physics.Students.Add(petko);

            School mySchool = new School();
            mySchool.Classes.Add(physics);

            foreach (var teacher in mySchool.Classes[0].Teachers)
            {
                Console.WriteLine(teacher.Name);
                Console.WriteLine(string.Join(", ", teacher.Comments));
            }

            foreach (var student in mySchool.Classes[0].Students)
            {
                Console.WriteLine(student.Name);
                Console.WriteLine(string.Join(", ", student.Comments));
            }
        }
示例#2
0
        public static void Main()
        {
            SchoolClass physics = new SchoolClass("physics");

            Teacher pesho = new Teacher("Pesho");

            physics.AddTeacher(pesho);

            Teacher gosho = new Teacher("Gosho");

            physics.AddTeacher(gosho);

            Teacher tosho = new Teacher("Tosho");

            physics.AddTeacher(tosho);
            tosho.AddComment("I am a comment");

            Student ivan = new Student("Vanko", "009");

            physics.Students.Add(ivan);

            Student petko = new Student("Pecata", "003");

            physics.Students.Add(petko);

            School mySchool = new School();

            mySchool.Classes.Add(physics);

            foreach (var teacher in mySchool.Classes[0].Teachers)
            {
                Console.WriteLine(teacher.Name);
                Console.WriteLine(string.Join(", ", teacher.Comments));
            }

            foreach (var student in mySchool.Classes[0].Students)
            {
                Console.WriteLine(student.Name);
                Console.WriteLine(string.Join(", ", student.Comments));
            }
        }
示例#3
0
 public void AddClass(SchoolClass currentClass)
 {
     this.Classes.Add(currentClass);
 }
示例#4
0
 public void AddClass(SchoolClass currentClass)
 {
     this.Classes.Add(currentClass);
 }