Example #1
0
        public static void Run()
        {
            Student aniPetrova    = new Student("Ani", " Petrova", 1);
            Student gerogiMalinov = new Student("Gerogi", " Malinov", 2);
            Student hristoVasilev = new Student("Hristo ", "Vasilev", 3);

            List <Student> studentsInClassA = new List <Student>();

            studentsInClassA.Add(aniPetrova);
            studentsInClassA.Add(gerogiMalinov);
            studentsInClassA.Add(hristoVasilev);

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("School Classes Tests");
            Console.ForegroundColor = ConsoleColor.White;

            foreach (var student in studentsInClassA)
            {
                Console.WriteLine(student.ToString());
            }

            Console.WriteLine();

            Discipline math     = new Discipline("Math", 10, 10);
            Discipline language = new Discipline("Language", 20, 10);
            Discipline art      = new Discipline("Art", 5, 10);

            Teacher petarPetrov = new Teacher("Petar", " Petrov");

            petarPetrov.AddDiscipline(math);
            petarPetrov.AddDiscipline(language);

            Teacher peshoPeshov = new Teacher("Pesho", "Peshov");

            peshoPeshov.AddDiscipline(art);

            List <Teacher> teachersForAClass = new List <Teacher>()
            {
                petarPetrov, peshoPeshov
            };

            Class classA = new Class("5A");

            classA.AddTeacher(petarPetrov);
            classA.AddTeacher(peshoPeshov);
            Console.WriteLine(classA.ToString() + "\n" + string.Join(", ", classA.Teachers));
            Console.WriteLine();

            // classA.AddComment("Hello");  /// uncoment to Thro exception
            classA.AddComment("Welcome! This is our first class.");
            classA.AddComment("This is our last class! Good Bye!");
        }
Example #2
0
        public static void Main()
        {
            var firstDiscipline  = new Discipline("HTML", 10, 10);
            var secondDiscipline = new Discipline("JavaScript", 25, 25);
            var thirdDiscipline  = new Discipline("CSS", 15, 5);

            var fourthDiscipline = new Discipline("OOP", 15, 20);

            fourthDiscipline.AddComment("Best course ever");

            var fifthDiscipline = new Discipline("C#", 20, 25);

            Teacher firstTeacher  = new Teacher("Ivancho", firstDiscipline, secondDiscipline, thirdDiscipline);
            Teacher secondTeacher = new Teacher("Marcheto", secondDiscipline, fourthDiscipline);

            Teacher thirdTeacher = new Teacher("Bojana", fifthDiscipline, thirdDiscipline);

            thirdTeacher.AddComment("Very lazy");

            Teacher fourthTeacher = new Teacher("Joreto", secondDiscipline, thirdDiscipline, fourthDiscipline, fifthDiscipline);
            Teacher fifthTeacher  = new Teacher("Albena", fourthDiscipline, fifthDiscipline, secondDiscipline);

            Class classA = new Class("A", firstTeacher, secondTeacher, thirdTeacher);

            classA.AddComment("The best class of the academy");

            Class classB = new Class("B", fourthTeacher, fifthTeacher);

            School telerikAcademy = new School();

            telerikAcademy.AddClass(classA);
            telerikAcademy.AddClass(classB);
        }
        private static List <Class> FillSchool()
        {
            List <Class> classes = new List <Class>();

            Class math = new Class(GetStudents(),
                                   "Mathematics",
                                   new Teacher("Chicho Mitko", new Discipline("Math", 2, 4), new Discipline("Physics", 2, 4)));

            math.AddStudent(new Student("Pesho", 5));
            math.AddTeacher(new Teacher("Chicho Gosho", new Discipline("Distillery", 4, 6)));
            math.AddComment("Yeah, quite interesting.");
            math.Teachers[1].Disciplines[0].AddComment("Beer.");

            classes.Add(math);

            Class philosophy = new Class(GetStudents(),
                                         "Phylosophy",
                                         new Teacher("Chicho Pencho", new Discipline("Math", 2, 4), new Discipline("Physics", 2, 4)),
                                         new Teacher("Chicho Gencho", new Discipline("Philosophy", 3, 5)));

            philosophy.Teachers[1].AddDiscipline(new Discipline("Transcendental metascience", 2, 1));
            philosophy.Teachers[0].AddComment("Everybody likes him.");

            classes.Add(philosophy);

            return(classes);
        }
Example #4
0
        public static void Main()
        {
            var firstDiscipline = new Discipline("HTML", 10, 10);
            var secondDiscipline = new Discipline("JavaScript", 25, 25);
            var thirdDiscipline = new Discipline("CSS", 15, 5);

            var fourthDiscipline = new Discipline("OOP", 15, 20);
            fourthDiscipline.AddComment("Best course ever");

            var fifthDiscipline = new Discipline("C#", 20, 25);

            Teacher firstTeacher = new Teacher("Ivancho", firstDiscipline, secondDiscipline, thirdDiscipline);
            Teacher secondTeacher = new Teacher("Marcheto", secondDiscipline, fourthDiscipline);

            Teacher thirdTeacher = new Teacher("Bojana", fifthDiscipline, thirdDiscipline);
            thirdTeacher.AddComment("Very lazy");

            Teacher fourthTeacher = new Teacher("Joreto", secondDiscipline, thirdDiscipline, fourthDiscipline, fifthDiscipline);
            Teacher fifthTeacher = new Teacher("Albena", fourthDiscipline, fifthDiscipline, secondDiscipline);

            Class classA = new Class("A", firstTeacher, secondTeacher, thirdTeacher);
            classA.AddComment("The best class of the academy");

            Class classB = new Class("B", fourthTeacher, fifthTeacher);

            School telerikAcademy = new School();
            telerikAcademy.AddClass(classA);
            telerikAcademy.AddClass(classB);
        }
        static void Main()
        {
            Student aniPetrova = new Student("Ani"," Petrova", 1);
            Student gerogiMalinov = new Student("Gerogi"," Malinov",2);
            Student hristoVasilev = new Student("Hristo ","Vasilev",3);

            List<Student> studentsInClassA = new List<Student>();
            studentsInClassA.Add(aniPetrova);
            studentsInClassA.Add(gerogiMalinov);
            studentsInClassA.Add(hristoVasilev);

            foreach (var student in studentsInClassA)
            {
                Console.WriteLine(student.ToString());
            }
            Console.WriteLine();

            Discipline math = new Discipline("Math", 10, 10);
            Discipline language = new Discipline("Language", 20, 10);
            Discipline art = new Discipline("Art", 5, 10);

            Teacher petarPetrov = new Teacher("Petar"," Petrov");
            petarPetrov.AddDiscipline (math);
            petarPetrov.AddDiscipline(language);

            Teacher peshoPeshov = new Teacher("Pesho" ,"Peshov");
            peshoPeshov.AddDiscipline(art);

            List<Teacher> teachersForAClass = new List<Teacher>() { petarPetrov, peshoPeshov };

            Class classA = new Class("5A");
            classA.AddTeacher(petarPetrov);
            classA.AddTeacher(peshoPeshov);
            Console.WriteLine(classA.ToString() + "\n" + string.Join("", classA.TeachersSet));

            classA.AddComment("Hello");
            classA.AddComment("This is our first class.");
            classA.AddComment("This is our last class!");
        }
Example #6
0
        static void Main(string[] args)
        {
            var student1   = new Student("Ivan Ivanov", 2);
            var student2   = new Student("Pesho Georgiev", 3);
            var student3   = new Student("Stamat Haralampiev", 2);
            var student4   = new Student("Strahil Ivanov", 3);
            var math       = new Disciplines("Mathematics", 10, 24);
            var library    = new Disciplines("Library", 15, 30);
            var csharp     = new Disciplines("CSharp", 20, 40);
            var javascript = new Disciplines("JavaScript", 22, 42);

            var teacher1 = new Teacher("Ginka Petkova", new List <Disciplines> {
                math, library
            });
            var teacher2 = new Teacher("Georgi Georgiev", new List <Disciplines> {
                csharp, javascript
            });
            var class1 = new Class("Class1", new List <Student> {
                student1, student2
            }, new List <Teacher> {
                teacher1, teacher2
            });
            var class2 = new Class("Class2", new List <Student> {
                student3, student4
            }, new List <Teacher> {
                teacher1, teacher2
            });
            var school = new School("Telerik Academy", new List <Class> {
                class1, class2
            });



            class2.AddComment("Important");
            school.AddClass(class1);
            teacher1.AddComment("Hello");
            class1.AddStudent(new Student("Hristo Popov", 4));
            class1.AddTeacher(new Teacher("Stanka Draganova", new List <Disciplines> {
                math, csharp
            }));
            teacher1.AddDiscipline(new Disciplines("Biology", 15, 25));
            math.AddComment("This is very important");
            student1.AddComment("Hello");
            Console.WriteLine(math.ToString());
        }
        static void Main()
        {
            Discipline historyOfFilm = new Discipline("History of Film", 10, 15);
            historyOfFilm.AddComment(@"Learn the history of film");

            Discipline filmDirecting = new Discipline("Film Directing",15,20);
            filmDirecting.AddComment(@"Learn fundamentals of film directing");

            Teacher pedro = new Teacher("Pedro", "Almodovar", new [] { historyOfFilm, filmDirecting });

            Class newClass = new Class("8B", pedro);
            newClass.AddComment("Otlichnici");
            Console.WriteLine(newClass.ToString());

            Console.WriteLine("Students:");
            Student gosho = new Student("Gosho", "Goshev", 1);
            Console.WriteLine(gosho);
        }
Example #8
0
        static void Main()
        {
            Discipline historyOfFilm = new Discipline("History of Film", 10, 15);

            historyOfFilm.AddComment(@"Learn the history of film");

            Discipline filmDirecting = new Discipline("Film Directing", 15, 20);

            filmDirecting.AddComment(@"Learn fundamentals of film directing");

            Teacher pedro = new Teacher("Pedro", "Almodovar", new [] { historyOfFilm, filmDirecting });

            Class newClass = new Class("8B", pedro);

            newClass.AddComment("Otlichnici");
            Console.WriteLine(newClass.ToString());

            Console.WriteLine("Students:");
            Student gosho = new Student("Gosho", "Goshev", 1);

            Console.WriteLine(gosho);
        }
Example #9
0
        static void Main()
        {
            var studentOne   = new Student("Goshko");
            var studentTwo   = new Student("Pencho");
            var studentThree = new Student("Stamat");
            var studentFour  = new Student("Toshko");
            var studentFive  = new Student("Gincho");

            var teacherOne   = new Teacher("Alex");
            var teacherTwo   = new Teacher("Vic");
            var teacherThree = new Teacher("Ste3v");

            var disciplineOne   = new Disciplines("Math", 6, 12);
            var disciplineTwo   = new Disciplines("c#", 8, 16);
            var disciplineThree = new Disciplines("JS", 2, 4);

            teacherOne.AddDiscipline(disciplineOne);
            teacherOne.AddDiscipline(disciplineTwo);

            teacherTwo.AddDiscipline(disciplineTwo);
            teacherOne.AddDiscipline(disciplineThree);
            teacherThree.AddDiscipline(disciplineOne);
            teacherThree.AddDiscipline(disciplineThree);

            var myClass = new Class("The most awesome class");

            myClass.AddStudent(studentOne);
            myClass.AddStudent(studentTwo);
            myClass.AddStudent(studentThree);
            myClass.AddStudent(studentFour);
            myClass.AddStudent(studentFive);
            myClass.AddTeacher(teacherOne);
            myClass.AddTeacher(teacherTwo);
            myClass.AddTeacher(teacherThree);

            var mySchool = new School();

            mySchool.AddClass(myClass);


            Console.WriteLine($"My School has a class: {myClass.TextID}");
            Console.WriteLine("The teachers in the class are:");
            foreach (var teacher in myClass.Teachers)
            {
                Console.WriteLine($"\t{teacher.Name} and he teaches:");
                foreach (var discipline in teacher.Disciplines)
                {
                    Console.WriteLine($"\t\t{discipline.Name} with {discipline.NumExercises} exercises and {discipline.NumLectures} lectures");
                }
            }
            Console.WriteLine("The students in the class are:");
            foreach (var student in myClass.Students)
            {
                Console.WriteLine($"\t{student.Name} with unique ID: {student.ClassNum}");
            }

            studentOne.AddComment("STUDENT ONE COMMENT");
            Console.WriteLine($"Student comment: {string.Join(", ", studentOne.MyComments)}");
            myClass.AddComment("CLASS COMMENT");
            Console.WriteLine($"Class comment: {string.Join(", ", myClass.MyComments)}");
            teacherOne.AddComment("TEACHER ONE COMMENT");
            Console.WriteLine($"Teacher comment: {string.Join(", ", teacherOne.MyComments)}");
            disciplineOne.AddComment("DISCIPLINE ONE COMMENT");
            Console.WriteLine($"Discipline comment: {string.Join(", ", disciplineOne.MyComments)}");
        }