Exemplo n.º 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));
            }
        }
 public SchoolClass(string cID, Teacher teacher = null, Student student = null)
 {
     this.ClassID = cID;
     this.Teachers = new List<Teacher>();
     if (teacher != null) this.Teachers.Add(teacher);
     this.Students = new List<Student>();
     if (student != null) this.Students.Add(student);
 }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Disciplins discipline = new Disciplins("Math", 10, 1000, "Haeavy Duty Discipline");

            Console.WriteLine("Discipline: {0} \nComment: {1}", discipline.Name, discipline.Comment);
            Console.WriteLine();

            Teacher teacher = new Teacher("g-n Telerikov", new List<Disciplins>(), "Goliama gad");

            Console.WriteLine("Teacher: {0} \nComment: {1}", teacher.Name, teacher.Comment);
            Console.WriteLine();

            Class1 class1 = new Class1("5-A", new List<Teacher>(), "Samo dvoikadjii");

            Console.WriteLine("Class: {0} \nComment: {1}", class1.ClassID, class1.Comment);
            Console.WriteLine();

            Student student = new Student("5-A", "Gosko", "Goliam zubur");

            Console.WriteLine("Student: {0} \nComment: {1}", student.Name, student.Comment);
            Console.WriteLine();

            teacher.ListOfDisciplines.Add(discipline);
            Console.WriteLine(teacher.ListOfDisciplines[0].Name);
        }
Exemplo n.º 4
0
        public static void Main()
        {
            Student simeon = new Student("Simeon", 1290122);
            Student petko = new Student("Petko", 1290871);
            Student joro = new Student("Joro", 1294424);

            Discipline java = new Discipline("Java", new HashSet<Student>() { simeon, petko }, 15);
            Discipline php = new Discipline("PHP", new HashSet<Student>() { petko, joro }, 10);

            Teacher nakov = new Teacher("Nakov", new HashSet<Discipline>() { java, php });
            Teacher karamfilov = new Teacher("Karamfilov", new HashSet<Discipline>() { php }, "Very punctual!");

            Class schClass = new Class("Robotics", new HashSet<Teacher>() { nakov, karamfilov }, new HashSet<Student>() { simeon, petko, joro });
            School MIT = new School(new HashSet<Class>() { schClass });
        }        
        static void Main(string[] args)
        {
            Student dani = new Student("Daniel", 19, 1233654789, "ambicious");
            Student vili = new Student("Vili", 19, 12323141231);

            IList<Student> students = new List<Student>() { dani, vili };

            Discipline math = new Discipline("mathemarics", 15, students, "hard...");

            Teacher minkova = new Teacher("Minkova", 45, new List<Discipline>() { math }, "very bad");

            Class september = new Class(students, new List<Teacher>() { minkova }, "September #2");

            School softUni = new School(new List<Class>() { september });

        }
Exemplo n.º 6
0
 public void AddTeacher(Teacher teacher)
 {
     this.Teachers.Add(teacher);
 }
Exemplo n.º 7
-1
        public static void Main()
        {
            Student ivan = new Student("Ivan", 1234567);
            Student george = new Student("George", 1290871);
            Student ani = new Student("Ani", 1290432);
            // Student mike = new Student("mike", 1290871);

            Discipline java = new Discipline("Java", new HashSet<Student>() { ivan, george }, 15);
            Discipline php = new Discipline("PHP", new HashSet<Student>() { ivan, ani }, 10);

            Teacher nakov = new Teacher("Nakov", new HashSet<Discipline>() { java, php });
            Teacher karamfilov = new Teacher("Karamfilov", new HashSet<Discipline>() { php }, "Very punctual!");

            Class schClass = new Class("Robotics", new HashSet<Teacher>() { nakov, karamfilov }, new HashSet<Student>() { ivan, george, ani });
            School MIT = new School(new HashSet<Class>() { schClass });
        }