Example #1
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);
        }
Example #2
0
 static void Main()
 {
     var disciplines = LoadDisciplines();
     School newSchool = new School("OU \"Yane Sandanski\"");
     newSchool.AddClass(new Class("1A"));
     newSchool.Classes[0].AddTeacher(new Teacher("Dora", "Chekanova", disciplines));
     newSchool.Classes[0].AddTeacher(new Teacher("Mita", "Georgieva", disciplines));
     newSchool.Classes[0].AddTeacher(new Teacher("Ivan", "Uzunov", disciplines));
     newSchool.AddClass(new Class("1B"));
     newSchool.Classes[1].AddTeacher(new Teacher("Desislava", "Botseva", disciplines));
     newSchool.Classes[1].AddTeacher(new Teacher("Elena", "Madjarova", disciplines));
     newSchool.Classes[1].AddTeacher(new Teacher("Mariyana", "Dimitrova", disciplines));
     Console.WriteLine("TEST FOR SCHOOL: \n" + newSchool);
     Class someClass = newSchool.Classes[0];
     Console.WriteLine("TEST FOR CLASS: \n" + someClass);
     Teacher someTeacher = newSchool.Classes[1].Teachers[1];
     Console.WriteLine("TEST FOR TEACHER: \n" + someTeacher);
     Console.WriteLine();
     Discipline someDiscipline = newSchool.Classes[0].Teachers[0].Disciplines[2];
     Console.WriteLine("TEST FOR DISCIPLINE: \n" + someDiscipline);
     Console.WriteLine();
     Student someStudent = new Student("Ivan", "Vasilev", 13);
     Console.WriteLine("TEST FOR STUDENT: \n" + someStudent);
     Console.WriteLine();
     Console.WriteLine("TEST FOR COMMENT FIELD: " + someStudent.Comment);
     someStudent.Comment = "{0} is the laziest student in the entire school!";
     Console.WriteLine();
     Console.WriteLine("TEST FOR COMMENT FIELD AFTER CHANGING THE TEXT: " + someStudent.Comment, someStudent.FirstName);
 }
Example #3
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);
        }
Example #4
0
        private static School LoadSchool()
        {
            School school = new School("Geo Milev");

            Class eightA = new Class("8a");

            eightA.Comment = "Will participate in the school project.";
            Class eightB = new Class("8b");

            Student pesho = new Student("Pesho");

            pesho.Comment = "Call the parents.";
            Student ivan = new Student("Ivan");

            Discipline math    = new Discipline("Math", 8, 8);
            Discipline physics = new Discipline("Physics", 6, 6);

            Teacher petrova = new Teacher("Petrova");
            Teacher ivanova = new Teacher("Ivanova");

            ivanova.Comment = "Agreed to show the kids the NASA shuttle.";

            petrova.AddDiscipline(math);
            ivanova.AddDiscipline(physics);

            eightA.AddStudent(pesho);
            eightA.AddTeacher(petrova);
            eightB.AddStudent(ivan);
            eightB.AddTeacher(ivanova);

            school.AddClass(eightA);
            school.AddClass(eightB);

            return(school);
        }
Example #5
0
        static void Main()
        {
            var    disciplines = LoadDisciplines();
            School newSchool   = new School("OU \"Yane Sandanski\"");

            newSchool.AddClass(new Class("1A"));
            newSchool.Classes[0].AddTeacher(new Teacher("Dora", "Chekanova", disciplines));
            newSchool.Classes[0].AddTeacher(new Teacher("Mita", "Georgieva", disciplines));
            newSchool.Classes[0].AddTeacher(new Teacher("Ivan", "Uzunov", disciplines));
            newSchool.AddClass(new Class("1B"));
            newSchool.Classes[1].AddTeacher(new Teacher("Desislava", "Botseva", disciplines));
            newSchool.Classes[1].AddTeacher(new Teacher("Elena", "Madjarova", disciplines));
            newSchool.Classes[1].AddTeacher(new Teacher("Mariyana", "Dimitrova", disciplines));
            Console.WriteLine("TEST FOR SCHOOL: \n" + newSchool);
            Class someClass = newSchool.Classes[0];

            Console.WriteLine("TEST FOR CLASS: \n" + someClass);
            Teacher someTeacher = newSchool.Classes[1].Teachers[1];

            Console.WriteLine("TEST FOR TEACHER: \n" + someTeacher);
            Console.WriteLine();
            Discipline someDiscipline = newSchool.Classes[0].Teachers[0].Disciplines[2];

            Console.WriteLine("TEST FOR DISCIPLINE: \n" + someDiscipline);
            Console.WriteLine();
            Student someStudent = new Student("Ivan", "Vasilev", 13);

            Console.WriteLine("TEST FOR STUDENT: \n" + someStudent);
            Console.WriteLine();
            Console.WriteLine("TEST FOR COMMENT FIELD: " + someStudent.Comment);
            someStudent.Comment = "{0} is the laziest student in the entire school!";
            Console.WriteLine();
            Console.WriteLine("TEST FOR COMMENT FIELD AFTER CHANGING THE TEXT: " + someStudent.Comment, someStudent.FirstName);
        }
Example #6
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);
        }
Example #7
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);
        }
Example #8
0
        static void Main()
        {
            var school   = new School("First English Language School");
            var students = new List <Student>
            {
                new Student("Slim", "Shady", 45000),
                new Student("Doctor", "Dre", 45002),
                new Student("Snoop", "Dog", 45005),
                new Student("T", "Pain", 45009)
            };

            var disciplines = new Dictionary <string, Discipline>
            {
                { "HTML", new Discipline("HTML", 5, 20) },
                { "CSS", new Discipline("CSS", 5, 20) },
                { "C#", new Discipline("C#", 12, 100) },
                { "JavaScript", new Discipline("JavaScript", 12, 120) },
                { "SQL", new Discipline("SQL", 4, 15) }
            };

            var teachers = new List <Teacher>
            {
                new Teacher("Nikolay", "Kostov", new List <Discipline> {
                    disciplines["C#"]
                }),
                new Teacher("Doncho", "Mitkov", new List <Discipline> {
                    disciplines["JavaScript"], disciplines["CSS"]
                }),
                new Teacher("Ivaylo", "Kenov", new List <Discipline> {
                    disciplines["C#"], disciplines["SQL"]
                }),
                new Teacher("Evlogy", "Georgiev", new List <Discipline> {
                    disciplines["JavaScript"], disciplines["HTML"]
                }),
            };

            var classes = new List <Class>
            {
                new Class("12D"),
                new Class("12V")
            };


            foreach (var @class in classes)
            {
                school.AddClass(@class);
            }

            @classes[1].AddTeacher(teachers[2]);

            foreach (var @class in school.GetClasses())
            {
                Console.WriteLine(@class);
            }

            classes[0].AddComment("This is a looooooooooong comment!");
            Console.Write(classes[0].Comments);

            // feel free to test the other functionalities out
        }
        public static void Main()
        {
            School school = new School("NPMG");

            Discipline mathematics = new Discipline("Matematics", 20, 50);
            Discipline geography   = new Discipline("Geography", 15, 20);
            Discipline biology     = new Discipline("Biology", 20, 30);

            Teacher firstTeacher = new Teacher("Petar Nedevski", new List <Discipline> {
                mathematics
            });
            Teacher secodTeacher = new Teacher("Dimo Padalski", new List <Discipline> {
                geography
            });
            Teacher thirdTeacher = new Teacher("Tatqna Bobeva", new List <Discipline> {
                biology
            });

            Student firstStudent  = new Student("Georgi Kolev", "7", "This is the best school!");
            Student secondStudent = new Student("Elena Dragusheva", "11");
            Student thirdStudent  = new Student("Valeriq Dimova", "6", "My class is perfect!");

            Class schoolClass = new Class("Class Z", new List <Student> {
                firstStudent, secondStudent, thirdStudent
            },
                                          new List <Teacher> {
                firstTeacher, secodTeacher, thirdTeacher
            });

            school.AddClass(schoolClass);

            Console.Write(school.ToString());
        }
Example #10
0
        static void Main()
        {
            //list of students
            var students = new List<Student>()
            {
             new Student("John", "Doe", 23840, 24, "male"),
            new Student("Jane", "Doe", 34653, 21, "female"),
            new Student("Alana", "Smith", 762342),
            };

            //list of teachers
            var teachers = new List<Teacher>()
            {
             new Teacher("Brian", "Jones"),
            new Teacher("Zoe", "Ferguson"),
            new Teacher("Bob", "Bobson"),
            };

            //adding disciplines
            teachers[0].AddDiscipline(new Discipline("Physics", 3, 4));
            teachers[0].AddDiscipline(new Discipline("Mathematics", 4, 5));
            teachers[1].AddDiscipline(new Discipline("Chemistry", 12, 5));
            teachers[1].AddDiscipline(new Discipline("Literature", 8, 4));
            teachers[2].AddDiscipline(new Discipline("Music", 8, 4));

            //creating school with a class and adding teachers
            var school = new School();
            school.AddClass(new Class("12A", teachers[0], teachers[1], teachers[2]));

            Console.WriteLine("Students: ");

            Console.WriteLine(new string('-', 30));

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

            Console.WriteLine("Teachers: ");

            Console.WriteLine(new string('-', 30));

            foreach (var teacher in teachers)
            {
                Console.WriteLine(teacher);
            }


            Console.WriteLine("School: ");

            Console.WriteLine(new string('-', 30));

            Console.WriteLine(school);


        }
Example #11
0
        static void Main(string[] args)
        {
            Student s1 = new Student("Popescu I", "2B", "Present");
            Student s2 = new Student("Dolanescu G", "3A", "Present");
            Student s3 = new Student("Gigi A", "2B", "Absent");
            Student s4 = new Student("Aionei F", "3A", "Present");

            Disciplines d1 = new Disciplines("Mathematics", 10, 30);
            Disciplines d2 = new Disciplines("French", 6, 10);
            Disciplines d3 = new Disciplines("Physics", 15, 9);
            Disciplines d4 = new Disciplines("Nature science", 12, 20);

            Teacher t1 = new Teacher("First Teacher");

            t1.AddDiscipline(d1);
            t1.AddDiscipline(d3);
            Teacher t2 = new Teacher("Second Teacher");

            t2.AddDiscipline(d2);
            t2.AddDiscipline(d4);


            Class c1 = new Class("3A");

            c1.AddTeacher(t1);
            c1.AddStudent(s2);
            c1.AddStudent(s4);

            Class c2 = new Class("2B");

            c2.AddTeacher(t2);
            c2.AddStudent(s1);
            c2.AddStudent(s3);

            School s = new School("Ion Creanga", "Iasi");

            s.AddClass(c1);
            s.AddClass(c2);

            s.Print();

            Console.ReadKey();
        }
        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);
        }
Example #13
0
        static void Main()
        {
            var school = new School("First English Language School");
            var students = new List<Student>
            {
                new Student("Slim", "Shady", 45000),
                new Student("Doctor", "Dre", 45002),
                new Student("Snoop", "Dog", 45005),
                new Student("T", "Pain", 45009)
            };

            var disciplines = new Dictionary<string, Discipline>
            {
                { "HTML", new Discipline("HTML", 5, 20) },
                { "CSS", new Discipline("CSS", 5, 20) },
                { "C#", new Discipline("C#", 12, 100) },
                { "JavaScript", new Discipline("JavaScript", 12, 120) },
                { "SQL", new Discipline("SQL", 4, 15) }
            };

            var teachers = new List<Teacher>
            {
                new Teacher("Nikolay", "Kostov", new List<Discipline> { disciplines["C#"] }),
                new Teacher("Doncho", "Mitkov", new List<Discipline> { disciplines["JavaScript"], disciplines["CSS"] }),
                new Teacher("Ivaylo", "Kenov", new List<Discipline> { disciplines["C#"], disciplines["SQL"] }),
                new Teacher("Evlogy", "Georgiev", new List<Discipline> { disciplines["JavaScript"], disciplines["HTML"] }),
            };

            var classes = new List<Class>
            {
                new Class("12D"),
                new Class("12V")
            };

            foreach (var @class in classes)
            {
                school.AddClass(@class);
            }

            @classes[1].AddTeacher(teachers[2]);

            foreach (var @class in school.GetClasses())
            {
                Console.WriteLine(@class);
            }

            classes[0].AddComment("This is a looooooooooong comment!");
            Console.Write(classes[0].Comments);

            // feel free to test the other functionalities out
        }
        static void Main()
        {
            List <Class> schoolClasses = FillSchool();
            School       someSchool    = new School(schoolClasses.ToArray());

            someSchool.AddClass(new Class(GetStudents(), "some class", new Teacher("Chicho Chocho", new Discipline("P.E.", 2, 4))));
            someSchool.Classes[1].AddComment("The best class.");

            string schoolInfo = someSchool.ToString();// Not a nice way to do it, but it fits the exercise;

            Console.WriteLine("School information:\n" + schoolInfo);

            someSchool.Classes[0].DeleteComment();
            Console.WriteLine("School info after deleting the comments about the class with classID Mathematics:");
            Console.WriteLine(someSchool.ToString());
        }
Example #15
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());
        }
Example #16
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);
        }
Example #17
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)}");
        }
        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);
        }