예제 #1
0
 static void Main()
 {
     Console.WriteLine("Small Test:");
     Student mara = new Student("Mara", 55);
     Student pesho = new Student("Pesho", 44);
     Teacher joro = new Teacher("Joro");
     Discipline math = new Discipline("Mathematics", 15, 4);
     joro.AddDiscipline(math);
     SchoolClass myClass = new SchoolClass("1a");
     myClass.AddStudent(mara);
     myClass.AddStudent(pesho);
     myClass.AddTeacher(joro);
     Console.WriteLine(myClass);
     try
     {
         SchoolClass myClass2 = new SchoolClass("1a");
     }
     catch (ArgumentException e)
     {
         Console.WriteLine(e.Message);
     }
     try
     {
         Student gosho = new Student("Gosho", 44);
     }
     catch (ArgumentException e)
     {
         Console.WriteLine(e.Message);
     }
 }
예제 #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);
        }
예제 #3
0
        public static void Main()
        {
            School school = new School("Test school");
            Console.WriteLine("School name: \"{0}\"\n", school.Name);

            var students = new List<Student>
            {
                new Student("Pesho", 1, "Class leader"),
                new Student("Gosho", 2),
                new Student("Ivo", 3),
                new Student("Doncho", 4)
            };

            Console.WriteLine("\nList of students: \n");

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

            var disciplines = new List<Discipline>
            {
                new Discipline("Math", 15, 15)
            };

            Discipline physics = new Discipline("Physics", 10, 10);
            disciplines.Add(physics);

            Console.WriteLine("\n\nList of disciplines:\n");

            foreach (var discipline in disciplines)
            {
                Console.WriteLine(discipline);
                Console.WriteLine();
            }

            Teacher peshov = new Teacher("Pesho Peshov", new List<Discipline>() { new Discipline("Physics", 10, 10) });
            Teacher goshev = new Teacher("Gosho Goshev", new List<Discipline>() { new Discipline("Math", 10, 10) });

            List<Teacher> teachers = new List<Teacher>() { peshov, goshev };

            Console.WriteLine("\nList of teachers:\n");

            foreach (Teacher teacher in teachers)
            {
                Console.WriteLine("{0} {1}", teacher.FullName, string.Join("\n", teacher.DisciplinesList));
                Console.WriteLine();
            }

            Class tenA = new Class("10 A",
                new List<Teacher>() { peshov },
                new List<Student>() { new Student("Toshko", 1), new Student("Peshka", 2) });

            Console.WriteLine("\nClass: ");
            Console.WriteLine(tenA);

            tenA.Comment = "Very good results last year!";
            Console.WriteLine("\n\nClass \"{0}\" comment: {1}\n", tenA.ClassID,tenA.Comment);
        }
예제 #4
0
        public void RemoveDiscipline(Discipline discpline)
        {
            if (!this.Disciplines.Contains(discpline))
            {
                throw new ArgumentException("There is no such discipline.");
            }

            this.Disciplines.Remove(discpline);
        }
예제 #5
0
        static void Main()
        {
            School mySchool = new School("Telerik Academy");

            // Creating students
            Student[] studentsFirstGroup = new Student[]
            {
                new Student("Georgi Yonchev", 2342032),
                new Student("Stamat Stamatov", 3023224),
                new Student("Pesho Ivanov", 3023434),
                new Student("Georgi Ivanov", 2223434),
                new Student("Mariya Ivanova", 4566434),
                new Student("Pesho Todorov", 2000032)
            };

            Student[] studentsSecondGroup = new Student[]
            {
                new Student("Georgi Petrov", 1342032),
                new Student("Albenoa Kalinova", 2333224),
                new Student("Zahari Zahariev", 3023555),
                new Student("Hristo Georgiev", 2234554),
                new Student("Nikoleta Zlatkova", 7765004),
                new Student("Nikoleta Chaneva", 3023100)
            };

            // Creating disciplines
            Discipline cSharp = new Discipline("C Sharp Fundamentals", 30, 30);
            Discipline javaScript = new Discipline("JavaScript Fundamentals", 40, 50);
            Discipline html = new Discipline("HTML5", 12, 13);
            Discipline css = new Discipline("CSS3");

            // Creating teachers
            Teacher teacher1 = new Teacher("Nikolay Kostov");
            Teacher teacher2 = new Teacher("Ivaylo Kenov");
            Teacher teacher3 = new Teacher("Doncho Minkov");
            Teacher teacher4 = new Teacher("Evlogi Hristov");

            teacher1.AddDiscipline(javaScript, html, css);
            teacher2.AddDiscipline(cSharp);
            teacher3.AddDiscipline(html);
            teacher4.AddDiscipline(css);

            // Creating Group classes
            SchoolClass firstGroupClass = new SchoolClass("First Group-morning");
            SchoolClass secondGroupClass = new SchoolClass("Second Group-evening");

            firstGroupClass.AddTeacher(teacher1, teacher2);
            secondGroupClass.AddTeacher(teacher1, teacher3, teacher4);

            firstGroupClass.AddStudent(studentsFirstGroup);
            secondGroupClass.AddStudent(studentsSecondGroup);

            mySchool.AddClass(firstGroupClass);
            mySchool.AddClass(secondGroupClass);
            Console.WriteLine(mySchool);
        }
        static void Main()
        {
            Student pesho = new Student("Pesho", 8);
            Student gosho = new Student("Gosho", 8, "kaval");
            Teacher stamatov = new Teacher("Stamatov", "bastun");
            Teacher petrova = new Teacher("Petrova");

            Class myClass = new Class("A");
            myClass.AddStudent(pesho);
            myClass.AddStudent(gosho);
            myClass.AddTeacher(stamatov);
            myClass.AddTeacher(petrova);

            Discipline biologia = new Discipline("biologia", 30, 30);
            Discipline matematika = new Discipline("matematika", 40, 40, "cool");

            stamatov.AddDiscipline(biologia);
            petrova.AddDiscipline(matematika);

            for (int i = 0; i < myClass.Students.Count; i++)
            {
                Console.WriteLine(myClass.Students[i].Name);
            }

            Console.WriteLine();
            myClass.RemoveStudent(pesho);

            for (int i = 0; i < myClass.Students.Count; i++)
            {
                Console.WriteLine(myClass.Students[i].Name);
            }

            Console.WriteLine();

            for (int i = 0; i < myClass.Teachers.Count; i++)
            {
                Console.WriteLine(myClass.Teachers[i].Name);
            }

            myClass.RemoveTeacher(petrova);
            Console.WriteLine();

            for (int i = 0; i < myClass.Teachers.Count; i++)
            {
                Console.WriteLine(myClass.Teachers[i].Name);
            }

            stamatov.AddDiscipline(matematika);
            Console.WriteLine();

            for (int i = 0; i < stamatov.Disciplines.Count; i++)
            {
                Console.WriteLine(stamatov.Disciplines[i].NameOfDiscipline);
            }
        }
예제 #7
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);
        }
        static void Main()
        {
            School school = new School("PMG");

            Class firstClass = new Class('A');
            Class secondClass = new Class('B');
            Class thirdClass = new Class('V');

            Teacher firstTeacher = new Teacher("Janeta", "super!");
            Teacher secondTeacher = new Teacher("Gonzo", "stranen");

            Student firstStudent = new Student("Ivan", "111213", "razdraznitelen");
            Student secondStudent = new Student("Dragan", "111214", "otkachen");
            Student thirdStudent = new Student("Petkan", "111215");
            Student forthStudent = new Student("Stamat", "111216", "uchenolubiv");

            Discipline math = new Discipline("Math", 5, 10);
            Discipline history = new Discipline("History", 2, 4);
            Discipline physics = new Discipline("Physics", 4, 8);
            Discipline english = new Discipline("English", 2, 4);

            school.AddClass(firstClass);
            school.AddClass(secondClass);
            school.AddClass(thirdClass);

            firstTeacher.AddDiscipline(math);
            firstTeacher.AddDiscipline(english);
            secondTeacher.AddDiscipline(history);
            secondTeacher.AddDiscipline(physics);

            firstClass.AddStudentToAClass(firstStudent);
            firstClass.AddStudentToAClass(secondStudent);
            secondClass.AddStudentToAClass(thirdStudent);
            thirdClass.AddStudentToAClass(forthStudent);

            firstClass.AddTeacherToAClass(firstTeacher);
            firstClass.AddTeacherToAClass(secondTeacher);
            secondClass.AddTeacherToAClass(firstTeacher);
            thirdClass.AddTeacherToAClass(secondTeacher);

            Console.WriteLine("School named {0} has {1} classes: \n\n {2} {3} {4}", school.Name, school.Classes.Count, firstClass, secondClass, thirdClass);
        }
        static void Main(string[] args)
        {
            Student Pesho = new Student("Pesho Konstancaliev", 24, "stupid!");
            Student Lacho = new Student("Lachezar Petrov", 2, "verry stupid!");
            Student Penka = new Student("Penka Grozdanova", 4, "not so stupid!");
            Student Evelina = new Student("Evelina Makedonska", 14, "stupid!");
            Student Evstati = new Student("Evstati Penev", 1, "verry stupid!");
            Student Drago = new Student("Drago Petrov", 11, "stupid!");
            Student Muncho = new Student("Muncho Gunchev", 13, "stupid!");

            Discipline Math = new Discipline("Math", 50, 50, "cool");
            Discipline Geography = new Discipline("Geography", 2, 4, "verry cool");
            Discipline Astronomy = new Discipline("Astronomy", 4, 10, "so-so");

            Teacher Tomov = new Teacher(new Discipline[] {Math, Geography}, "Pesho Tomov", "stupid!");
            Teacher Petrov = new Teacher(new Discipline[] { Astronomy, Geography }, "Harampi Petrov", "verry stupid!");
            Teacher Dragov = new Teacher(new Discipline[] { Math, Astronomy }, "Drago Dragov", "stupid!");
            Teacher Haralambev = new Teacher(new Discipline[] { Math, Geography }, "Mryshtio Haralambev", "stupid!");

            ClassOfStudents theCoolestClass = new ClassOfStudents(new Student[] { Pesho, Evelina, Evstati, Drago }, new Teacher[] { Dragov, Haralambev, Tomov }, "5b");
        }
        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!");
        }
예제 #11
0
 public Teacher(Discipline[] disciplines, string name, string comment)
     : this(disciplines, name)
 {
     this.Comment = comment;
 }
예제 #12
0
 public Teacher(Discipline[] disciplines, string name)
 {
     this.TeacherDisciplines = disciplines;
     Name = name;
 }
예제 #13
0
        public static void Main()
        {
            var school = new School("PG Gen. Vl. Zaimov");

            //students
            var ivan   = new Student("Ivan Ivanov", 100011);
            var stoyan = new Student("Stoyan Stoyanov", 100012);
            var dragan = new Student("Dragan Draganov", 200011);
            var pesho  = new Student("Pesho Peshov", 200012);

            //teachers
            var ivo    = new Teacher("Ivaylo Kenov");
            var niki   = new Teacher("Nikolay Kostov");
            var doncho = new Teacher("Doncho Minkov");
            var evlogi = new Teacher("Evlogi Hristov");

            //classes
            var firstClass  = new SchoolClass("100");
            var secondClass = new SchoolClass("200");

            //disciplines
            var geography = new Discipline("Geography", 2, 2);
            var history   = new Discipline("History", 1, 2);
            var biology   = new Discipline("Biology", 3, 1);
            var math      = new Discipline("Math", 3, 2);
            var mpt       = new Discipline("MPT", 1, 3);

            //adding classes to school
            school.AddClass(firstClass);
            school.AddClass(secondClass);

            //adding teachers and students to classes
            firstClass.AddStudents(ivan);
            firstClass.AddStudents(stoyan);
            firstClass.AddTeachers(ivo);
            firstClass.AddTeachers(evlogi);

            secondClass.AddStudents(dragan);
            secondClass.AddStudents(pesho);
            secondClass.AddTeachers(doncho);
            secondClass.AddTeachers(niki);

            //adding disciplines to teachers
            ivo.AddDisciplines(geography);
            niki.AddDisciplines(biology);
            doncho.AddDisciplines(mpt);
            doncho.AddDisciplines(geography);
            ivo.AddDisciplines(history);
            evlogi.AddDisciplines(biology);

            ivan.Comment = "I like geography!";

            doncho.Comment = "Something.";

            geography.Comment = "Surface of Earth......";

            firstClass.Comment = "Advanced.";

            Console.WriteLine("{0, 28}", school);
            Console.WriteLine(new string('*', 40));
            Console.WriteLine("Class identifier: {0}", firstClass);
            Console.WriteLine("\nStudents: \n{0}", firstClass.GetStudents());
            Console.WriteLine("Teachers: \n{0}", firstClass.GetTeachers());
            Console.WriteLine("Teacher's disciplines: ");
            Console.WriteLine("{0}\n{1}", ivo, ivo.GetDisciplines());
            Console.WriteLine("{0}\n{1}", evlogi, evlogi.GetDisciplines());

            Console.WriteLine("Comments:");
            Console.WriteLine("{0}: {1}", ivan.Name, ivan.Comment);
            Console.WriteLine("{0}: {1}", geography.Name, geography.Comment);
        }
예제 #14
0
 public void RemoveDiscipline(Discipline discipline)
 {
     this.teachersDisciplines.Remove(discipline);
 }
예제 #15
0
 public void AddDiscipline(Discipline discipline)
 {
     this.teachersDisciplines.Add(discipline);
 }
예제 #16
0
 // A method do remove a discipline
 public void RemoveDiscipline(Discipline discipline)
 {
     this.Disciplines.Remove(discipline);
 }
예제 #17
0
        public static void Main()
        {
            School school = new School("Test School");

            Console.WriteLine("School name: \"{0}\"\n", school.Name);

            var students = new List <Student>
            {
                new Student("Grafa", 1, "Class leader"),
                new Student("Mara", 2),
                new Student("Miro", 3),
                new Student("Lyubcho", 4)
            };

            Console.WriteLine("\nList of students:\n");

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

            var disciplines = new List <Discipline>
            {
                new Discipline("Maths", 15, 15)
            };

            Discipline physics = new Discipline("Physics", 10, 10);

            disciplines.Add(physics);

            Console.WriteLine("\n\nList of disciplines:\n");

            foreach (var discipline in disciplines)
            {
                Console.WriteLine(discipline);
                Console.WriteLine();
            }

            Teacher petrova = new Teacher("Tsanka Petrova", new List <Discipline>()
            {
                new Discipline("Physics", 10, 10)
            });
            Teacher pavlov = new Teacher("Tosho Pavlov", new List <Discipline>()
            {
                new Discipline("Maths", 10, 10)
            });

            List <Teacher> teachers = new List <Teacher>()
            {
                petrova, pavlov
            };

            Console.WriteLine("\nList of teachers:\n");

            foreach (Teacher teacher in teachers)
            {
                Console.WriteLine("{0} {1}", teacher.FullName, string.Join("\n", teacher.DisciplinesList));
                Console.WriteLine();
            }

            Class tenA = new Class("10 A",
                                   new List <Teacher>()
            {
                petrova
            },
                                   new List <Student>()
            {
                new Student("Todor", 1), new Student("Yana", 2)
            });

            Console.Write("\nClass: ");
            Console.WriteLine(tenA);

            tenA.Comment = "Very good results last year!";
            Console.WriteLine("\n\nClass \"{0}\" comment: {1}\n", tenA.ClassID, tenA.Comment);
        }
예제 #18
0
        public static void Main()
        {
            var school = new School("PG Gen. Vl. Zaimov");

            //students
            var ivan = new Student("Ivan Ivanov", 100011);
            var stoyan = new Student("Stoyan Stoyanov", 100012);
            var dragan = new Student("Dragan Draganov", 200011);
            var pesho = new Student("Pesho Peshov", 200012);

            //teachers
            var ivo = new Teacher("Ivaylo Kenov");
            var niki = new Teacher("Nikolay Kostov");
            var doncho = new Teacher("Doncho Minkov");
            var evlogi = new Teacher("Evlogi Hristov");

            //classes
            var firstClass = new SchoolClass("100");
            var secondClass = new SchoolClass("200");

            //disciplines
            var geography = new Discipline("Geography", 2, 2);
            var history = new Discipline("History", 1, 2);
            var biology = new Discipline("Biology", 3, 1);
            var math = new Discipline("Math", 3, 2);
            var mpt = new Discipline("MPT", 1, 3);

            //adding classes to school
            school.AddClass(firstClass);
            school.AddClass(secondClass);

            //adding teachers and students to classes
            firstClass.AddStudents(ivan);
            firstClass.AddStudents(stoyan);
            firstClass.AddTeachers(ivo);
            firstClass.AddTeachers(evlogi);

            secondClass.AddStudents(dragan);
            secondClass.AddStudents(pesho);
            secondClass.AddTeachers(doncho);
            secondClass.AddTeachers(niki);

            //adding disciplines to teachers
            ivo.AddDisciplines(geography);
            niki.AddDisciplines(biology);
            doncho.AddDisciplines(mpt);
            doncho.AddDisciplines(geography);
            ivo.AddDisciplines(history);
            evlogi.AddDisciplines(biology);

            ivan.Comment = "I like geography!";

            doncho.Comment = "Something.";

            geography.Comment = "Surface of Earth......";

            firstClass.Comment = "Advanced.";

            Console.WriteLine("{0, 28}", school);
            Console.WriteLine(new string('*', 40));
            Console.WriteLine("Class identifier: {0}", firstClass);
            Console.WriteLine("\nStudents: \n{0}", firstClass.GetStudents());
            Console.WriteLine("Teachers: \n{0}", firstClass.GetTeachers());
            Console.WriteLine("Teacher's disciplines: ");
            Console.WriteLine("{0}\n{1}",ivo, ivo.GetDisciplines());
            Console.WriteLine("{0}\n{1}", evlogi, evlogi.GetDisciplines());

            Console.WriteLine("Comments:");
            Console.WriteLine("{0}: {1}", ivan.Name, ivan.Comment);
            Console.WriteLine("{0}: {1}", geography.Name, geography.Comment);
        }
예제 #19
0
 public void AddDisciplines(Discipline discipline)
 {
     this.Disciplines.Add(discipline);
 }
예제 #20
0
 public void AddDiscipline(Discipline discipline)
 {
     this.SetOfDisciplines.Add(discipline);
 }
예제 #21
0
 public void RemoveDisciplines(Discipline discipline)
 {
     this.Disciplines.Remove(discipline);
 }