Esempio n. 1
0
        static void Main(string[] args)
        {
            Student studentOne = new Student("Ivan", "Dvoikadjiq", 1);
            Student studentTwo = new Student("Maria", "Otlichnik", 2);
            Student studentThree = new Student("Ana", 3);
            
            IList<Student> students = new List<Student>();
            students.Add(studentOne);
            students.Add(studentTwo);
            students.Add(studentThree);

            Discipline disciplineOne = new Discipline("Matematika", 12, students, "muka");
            Discipline disciplineTwo = new Discipline("Muzika", 12, students);

            IList<Discipline> disciplines = new List<Discipline>();
            disciplines.Add(disciplineOne);
            disciplines.Add(disciplineTwo);

            Teacher teacherOne = new Teacher("Petko", disciplines);

            IList<Teacher> teachers = new List<Teacher>();
            teachers.Add(teacherOne);

            Class classOne = new Class("Detska gradina", students, teachers);
            Console.WriteLine(classOne);
        }
Esempio n. 2
0
 static void Main(string[] args)
 {
     try
     {
         //test
         School.Number = 50;
         School.Name = "СОУ Драган Драганов";
         //add 2 classes
         Class class1 = new Class("012");
         Class class2 = new Class("035");
         School.NewClass(class1);
         School.NewClass(class2);
         //some Disciplines
         List<Discipline> disciplines1 = new List<Discipline>
             {new Discipline("Nuclear Physics", 1, -1),      //will throw error
              new Discipline("Astrophysics", 1, 2)};
         List<Discipline> disciplines2 = new List<Discipline>
             {new Discipline("Analysis", 2, 1),
              new Discipline("Applied mathematics", 2, 1)};
         List<Discipline> disciplines3 = new List<Discipline>
             {new Discipline("Painting", 1, 3),
              new Discipline("Photography", 1, 3)};
         //some Teachers
         List<Teacher> teachers = new List<Teacher>
             {new Teacher("M. Petrov"),
              new Teacher("L. Borisova"),
              new Teacher("K. Nakov")};
         //some students
         List<Student> students = new List<Student>
             {new Student("Gosho P.", 10),
              new Student("Pesho B.", 10),
              new Student("Sasho K.", 10)};
         List<Student> students2 = new List<Student>
             {new Student("Misho P.", 10),
              new Student("Tosho B.", 10),
              new Student("Rasho K.", 10)};
         //add teachers and students to each class
         class1.AddTeachers(teachers);
         class1.AddStudents(students);
         class2.AddTeachers(teachers);
         class2.AddStudents(students2);
         //add disciplines for each Teacher
         class1.SetOfTeachers[0].AddDisciplines(disciplines1);
         class1.SetOfTeachers[1].AddDisciplines(disciplines2);
         class1.SetOfTeachers[2].AddDisciplines(disciplines3);
         class2.SetOfTeachers[0].AddDisciplines(disciplines1);
         class2.SetOfTeachers[1].AddDisciplines(disciplines2);
         class2.SetOfTeachers[2].AddDisciplines(disciplines3);
     }
     catch (Exception ex)
     {
         // Get stack trace for the exception with source file information
         var stack = new StackTrace(ex, true);
         // Get the top stack frame
         var frame = stack.GetFrame(0);
         // Get the line number from the stack frame
         //var lineNumber = frame.GetFileLineNumber();
         Console.WriteLine(ex.Message + "\n" + frame);
     }
 }
Esempio n. 3
0
        static void Main()
        {
            School justSchool = new School("JustSchool");

            Teacher ivanov = new Teacher("Ivanov");
            Teacher metodiev = new Teacher("Metodiev");

            Student milko = new Student("Milko", 15);
            Student vasil = new Student("Vasil", 2);

            Class bClass = new Class("BClass");

            Discipline math = new Discipline("Math", 5, 10);
            Discipline chemistry = new Discipline("Chemistry", 5, 12);

            justSchool.Classes.Add(bClass);

            bClass.Students.Add(milko);
            bClass.Students.Add(vasil);
            bClass.Teachers.Add(ivanov);
            bClass.Teachers.Add(metodiev);

            ivanov.Disciplines.Add(math);
            metodiev.Disciplines.Add(chemistry);

            bClass.Comment = "Pros";
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Student first=new Student("Mariq","564710");
            Student second = new Student("Pesho", "111123", "Gouem pich");
            Student third = new Student("Ganka", "126578");
            Disciplines basic = new Disciplines(10, "C# programming", "This is the prepration level at SoftUni.");
            Disciplines intermediate = new Disciplines(20, "Object Oriented Programming");
            Disciplines advanced = new Disciplines(30, "Structures of data and Algorithms", "This is the third level in SoftUni.");
            List<Student> students = new List<Student>();
            students.Add(first);
            students.Add(second);
            students.Add(third);

            List<Disciplines>SetOne=new List<Disciplines>();
            SetOne.Add(intermediate);
            SetOne.Add(intermediate);
            SetOne.Add(advanced);
            Teacher Nakov = new Teacher("Nakov", SetOne, "Gouem pich too :)");
            Teacher Znaiko = new Teacher("Znaiko", SetOne);
            List<Teacher> teachers = new List<Teacher>();
            teachers.Add(Nakov);
            teachers.Add(Znaiko);
            Class begginers = new Class(teachers,students);
            
        }
        static void Main()
        {
            Teacher tomas = new Teacher("Tomas", "Fernandes");
            tomas.Disciplines.Add(new SchoolDiscipline(Subject.Calculus, 30, 45));
            Class firstA = new Class("1a");
            firstA.AddStudent(new Student("ivan", "ivanoq", 12));
            firstA.AddStudent(new Student("iwan", "ivanqv", 15));
            firstA.AddStudent(new Student("ivrn", "ivaeov", 2));
            firstA.AddStudent(new Student("ivat", "ivynov", 22));
            firstA.AddStudent(new Student("yvan", "itanov", 35));
            firstA.AddStudent(new Student("eqan", "iranov", 5));
            firstA.AddStudent(new Student("vern", "evanov", 1));

            Console.Write("ShowStudent() method: ");
            firstA.ShowStudent(15);

            SchoolDiscipline biology = new SchoolDiscipline(Subject.Biology, 30, 30);

            firstA.AddTeacher(tomas);
            firstA.AddTeacher(new Teacher("Tom", "Ferandes", Subject.Algebra));
            firstA.AddTeacher(new Teacher("Tas", "Fernades", biology));
            firstA.AddTeacher(new Teacher("Tos", "Fernand"));
            firstA.AddTeacher(new Teacher("Toms", "Fendes"));
            firstA.AddTeacher(new Teacher("Toas", "Fende"));

            Console.Write("ShowTeacher() method: ");
            firstA.ShowTeacher(biology);

            Console.WriteLine("ToString() method for class: ");
            Console.WriteLine(firstA);
        }
Esempio n. 6
0
        static void Main()
        {
            Class class12a = new Class("12a", LoadStudents(), LoadTeachers());

            for (int i = 0; i < class12a.Students.Count; i++)
            {
                Console.WriteLine("Student name: {0}", class12a.Students[i].Name);
                Console.WriteLine("Class number: {0}\n", class12a.Students[i].ClassNumber);
            }

            Console.WriteLine("\nTeacher name: {0}", class12a.Teachers[1].Name);
            Console.WriteLine("Disciplines:");
            Console.WriteLine("{0}", class12a.Teachers[1].Disciplines[2].Name);
            Console.WriteLine("{0}", class12a.Teachers[1].Disciplines[3].Name);
            Console.WriteLine();
        }
Esempio n. 7
0
        //a method for creating a new test school with predifined details
        //only the students are random picked ->check CreatArray method in Student class
        public static School New()
        {
            //create two student list with random details
            List<Student> exampleStudents1 = Student.CreateArray(10);
            List<Student> exampleStudents2 = Student.CreateArray(10);

            //create several disciplines with their names, lecture hours and exercies hours
            Discipline chemistry = new Discipline("Chemistry", 3, 3);
            Discipline history = new Discipline("History", 2, 2);
            Discipline mathematics = new Discipline("Mathematics", 4, 4);
            Discipline sport = new Discipline("Sport", 5, 5);

            //create list of disciplines for one of the teachers
            List<Discipline> exampleTeacher1Disciplines = new List<Discipline>();
            exampleTeacher1Disciplines.Add(chemistry);
            exampleTeacher1Disciplines.Add(mathematics);

            //create list of disciplines for the other teacher
            List<Discipline> exampleTeacher2Disciplines = new List<Discipline>();
            exampleTeacher2Disciplines.Add(history);
            exampleTeacher2Disciplines.Add(sport);

            //create two teachers and assign one list of disciplines to each of them
            Teacher exampleTeacher1 = new Teacher("Blagoy Stankov", exampleTeacher1Disciplines);
            Teacher exampleTeacher2 = new Teacher("Todor Trendafilov", exampleTeacher2Disciplines);

            //create a new class and add students and teacher to the class
            Class a12 = new Class("12a");
            a12.AddGroupStudents(exampleStudents1);
            a12.AddTeacher(exampleTeacher1);

            //create another class and add students and teacher to the class
            Class b12 = new Class("12b");
            b12.AddGroupStudents(exampleStudents2);
            b12.AddTeacher(exampleTeacher2);

            //create a new school
            School exampleSchool = new School("SOU Petko Rachov Slaveikov");

            //assign both classes to the school
            exampleSchool.AddClass(a12);
            exampleSchool.AddClass(b12);

            return exampleSchool;
        }
Esempio n. 8
0
        static void Main()
        {
            List<Student> students = new List<Student>
            {
                new Student("Gosho", 1),
                new Student("Pesho", 3),
                new Student("Tosho", 2),
                new Student("Ivan", 4),
                new Student("Gergana", 5)
            };

            var html = new Discipline("HTML", 1);
            html.AddStudent(students[0]);
            html.AddStudent(students[2]);
            html.AddStudent(students[4]);
            html.Ditails = "Fast-Track";

            var css = new Discipline("CSS", 2);
            css.AddStudent(students[0]);
            css.AddStudent(students[1]);
            css.AddStudent(students[2]);

            var csharp = new Discipline("C#", 3);
            csharp.AddStudent(students[1]);
            csharp.AddStudent(students[3]);
            csharp.AddStudent(students[4]);

            var javaScript = new Discipline("JavaScript", 4, students);

            var cSharpTeacher = new Teacher("Svetlin Nakov");
            cSharpTeacher.AddDiscipline(csharp);

            var webFundamentalsTeacher = new Teacher("Vladimir Georgiev");
            webFundamentalsTeacher.AddDiscipline(html);
            webFundamentalsTeacher.AddDiscipline(css);

            var classA = new Class("A", new List<Teacher> { cSharpTeacher, webFundamentalsTeacher });

            Console.WriteLine(classA.ToString());
        }
Esempio n. 9
0
        static void Main(string[] args)
        {
            Student student1 = new Student("Kiril", 13);
            student1.AddComment("Test comment1 for student 1");
            student1.AddComment("Test comment2 for student 1");

            Student student2 = new Student("Vasil", 25);
            student2.AddComment("Test comment1 for student 2");
            student2.AddComment("Test comment2 for student 2");

            student1.RemoveComment("Test comment1 for student 1");
            student1.DisplayComments();

            student2.ClearComments();
            student2.DisplayComments();

            student1.AddComment("Blah blah");
            Console.WriteLine(student1.CommentsCount);
            student1.RemoveCommentAt(0);
            student1.DisplayComments();

            Discipline discipline1 = new Discipline("Discrete Mathematics", 1, 1);
            Discipline discipline2 = new Discipline("Mathematical Analysis", 1, 1);
            Discipline discipline3 = new Discipline("OOP", 2, 3);

            discipline1.AddComment("Introduction do discrete data structures.");
            discipline3.AddComment("Object Oriented Programming in C#");

            Teacher teacher1 = new Teacher("Trifon",
                new List<Discipline>() { discipline1 });

            Teacher teacher2 = new Teacher("Grigor",
                new List<Discipline>() { discipline2, discipline3 });

            Class class1 = new Class("312",
                new List<Teacher>() { teacher1, teacher2} ,
                new List<Student>() { student1, student2} );

            School school = new School(new List<Class>() { class1 });
        }
Esempio n. 10
0
        public static void Main()
        {
            Student st1 = new Student("Pesho", "0102030405");
            Student st2 = new Student("Kiro", "0102020304");
            Student st3 = new Student("Penka", "0102020304");

            st1.Details = "Golem pich";
            Console.WriteLine(st1);
            Console.WriteLine();

            Discipline oop = new Discipline("OOP", 12);
            oop.AddStudent(st1);
            oop.AddStudent(st2);
            oop.Students.Add(st3); //will not work - you have to use the method AddStudent

            Discipline java = new Discipline("Java", 6);
            java.AddStudent(st3);

            //Console.WriteLine(st1.Details);
            Console.WriteLine(oop);
            Console.WriteLine(java);
            Console.WriteLine();

            Teacher t1 = new Teacher("Bai Ivan");
            t1.AddDiscipline(oop);
            t1.AddDiscipline(java);
            t1.Details = "Naj-dobriq daskal!";

            Console.WriteLine(t1);
            Console.WriteLine();

            Class cl1 = new Class("Alpha");
            cl1.AddTeacher(t1);
            cl1.AddStudent(st1);
            cl1.AddStudent(st2);
            cl1.AddStudent(st3);

            Console.WriteLine(cl1);
        }
Esempio n. 11
0
        static void Main()
        {
            Student student1 = new Student("Ivan", 15);
            Student student2 = new Student("Petkan", 17);
            Student student3 = new Student("Dragan", 19);

            Class osmiB = new Class("osmi B");
            osmiB.SetOfStudents.Add(student1);
            osmiB.SetOfStudents.Add(student2);
            osmiB.SetOfStudents.Add(student3);

            Teacher teacher1 = new Teacher("Anatoli");
            Teacher teacher2 = new Teacher("Cvetkan");

            osmiB.SetOfTeachers.Add(teacher1);
            osmiB.SetOfTeachers.Add(teacher2);

            Discipline math = new Discipline("Math", 5, 4);
            Discipline history = new Discipline("History", 9, 8);
            Discipline geography = new Discipline("Geography", 4, 9);
            Discipline science = new Discipline("Science", 5, 4);

            teacher1.SetOfDisciplines.Add(math);
            teacher1.SetOfDisciplines.Add(history);

            teacher2.SetOfDisciplines.Add(geography);
            teacher2.SetOfDisciplines.Add(science);

            Console.WriteLine("The class {0} has those students : \n",osmiB.UnicTxtInd);
            Console.WriteLine(osmiB.StudentToString());
            Console.WriteLine("Some teachers:");
            Console.WriteLine(osmiB.TeacherToString());

            teacher1.AddComment("This is some optional comment");
            string comment=teacher1.ShowComment();
            Console.WriteLine(comment);
        }
        static void Main()
        {
            List<Student> students = new List<Student>();
            students.Add(new Student("542", "Georgi Georgiev"));
            students.Add(new Student("111", "Georgi Kadiev"));
            students.Add(new Student("432", "Ivan Georgiev"));
            students.Add(new Student("974", "Petar Petrov"));
            students.Add(new Student("214", "Atanas Iliev"));

            List<Disciplines> disciplines = new List<Disciplines>();
            disciplines.Add(new Disciplines(11, students, "Physics"));
            disciplines.Add(new Disciplines(15, students, "Math"));
            disciplines.Add(new Disciplines(20, students, "Programming"));

            List<Teacher> teachers = new List<Teacher>();
            teachers.Add(new Teacher(disciplines, "Svetlin Nakov", "The Software Guru"));
            teachers.Add(new Teacher(disciplines, "Petur Hubchev"));

            Class classA = new Class(teachers, "A");
            Class classV = new Class(teachers, "V");

            Console.WriteLine(classA);
            Console.WriteLine(classV);
        }
Esempio n. 13
0
        public static void Main(string[] args)
        {
            var pesho = new Student("Pesho", "201411V21", "very tallented, self-critical");
            var misho = new Student("Misho", "201411V13");

            // Student gatyo = new Student("Gosho", "201411V13"); // should throw exception
            var gosho = new Student("Gosho", "201412V13");
            var katya = new Student("Katya", "201412V19", "likes litterature, expecially indian novels of Karl May");

            var maths = new Discipline("Mathematics", 35, new List<Student>() { pesho, gosho, misho });
            var litterature = new Discipline("Litterature", 15, new List<Student>() { gosho, misho, katya }, "optional");
            var informatics = new Discipline("Informatics", 50, new List<Student>() { pesho, gosho, katya, misho }, "main discipline");

            var peshova = new Teacher("Peshova", new List<Discipline>() { litterature });
            var dushkov = new Teacher("Dushkov", new List<Discipline>() { maths, informatics });

            var class201411V = new Class("201411V", new List<Student>() { pesho, misho }, new List<Teacher>() { peshova });

            // below row should throw exception
            // SchoolClass class201412 = new Class("201411V", new List<Student>() { }, new List<Teacher>() { peshova, dushkov });
            var class201412V = new Class("201412V", new List<Student>() { }, new List<Teacher>() { peshova, dushkov });

            var eg = new School(new List<Class>() { class201411V, class201412V });
        }
Esempio n. 14
0
 public void AddClass(Class schoolClass)
 {
     this.schoolClasses.Add(schoolClass);
 }
Esempio n. 15
0
 public void AddClass(Class temp)
 {
     classes.Add(temp);
 }
Esempio n. 16
0
 public Students(string name, int unicClassNumber, Class _class, string comment = "")
     : base(name, comment)
 {
     this.unicClassNumber = unicClassNumber;
     this.Class = _class;
 }
Esempio n. 17
0
        static void Main()
        {
            //define students
            Student firstStudent = new Student("Ivan Ivanov", 26);
            firstStudent.AddComment("I love school.");
            Student secondStudent = new Student("Kiril Stoianov", 21);
            secondStudent.AddComment("I hate school.");
            Student thirdStudent = new Student("Martin Hristov", 25);
            Student[] allStudents = {
                                       firstStudent,
                                       secondStudent,
                                       thirdStudent
                                   };

            //define disciplines
            Discipline math = new Discipline("Math", 4, 4);
            math.AddComment("This is the hardest discipline, but it's very useful.");
            Discipline biology = new Discipline("Biology", 2, 2);
            Discipline chemistry = new Discipline("Chemistry", 1, 2);
            chemistry.AddComment("This is the most useless discipline.");
            Discipline[] allDisciplines = {
                                              math,
                                              biology,
                                              chemistry
                                          };

            //define teachers and add disciplines
            Teacher firstTeacher = new Teacher("Nikolai Nikolov");
            firstTeacher.AddDicipline(math);
            firstTeacher.AddDicipline(chemistry);

            Teacher secondTeacher = new Teacher("Silviq Stefanova");
            secondTeacher.AddComment("She's a great teacher.");
            secondTeacher.AddDicipline(biology);

            Teacher[] allTeachers = {
                                        firstTeacher,
                                        secondTeacher
                                    };

            //create class
            Class firstClassInSchool = new Class("12A");
            //add students in class
            firstClassInSchool.AddStudents(allStudents);
            //add teachers for class
            firstClassInSchool.AddTeachers(allTeachers);
            Class[] allClasses = {
                                        firstClassInSchool
                                    };

            //Define school and display information
            School mySchool = new School("1st Math Highschool");

            //display info
            Console.WriteLine("-------{0}-------", mySchool.Name);
            Console.WriteLine();

            Console.WriteLine("---Teachers---");
            foreach (var teacher in allTeachers)
            {
                foreach (var discipline in teacher.AllDiciplines)
                {
                    Console.WriteLine("{0} -> {1}", teacher, discipline);
                }
            }

            Console.WriteLine();

            Console.WriteLine("---Classes---");
            foreach (var schoolClass in allClasses)
            {
                Console.WriteLine(schoolClass);
            }

            Console.WriteLine();

            //Display Comments
            Console.WriteLine("---Comments---");
            foreach (var schoolClass in allClasses)
            {
                schoolClass.ViewComments();
            }

            Console.WriteLine();

            foreach (var student in allStudents)
            {
                student.ViewComments();
            }

            Console.WriteLine();

            foreach (var teacher in allTeachers)
            {
                teacher.ViewComments();
            }

            Console.WriteLine();

            foreach (var discipline in allDisciplines)
            {
                discipline.ViewComments();
            }
        }
 public void AddClass(Class c)
 {
     this.classes.Add(c.Id, c);
 }
Esempio n. 19
0
 public void RemoveClass(Class classToRemove)
 {
     this.classes.Remove(classToRemove);
 }
Esempio n. 20
0
 public void AddClass(Class newClass)
 {
     this.classes.Add(newClass);
 }
Esempio n. 21
0
 public static void NewClass(Class newClass)
 {
     Classes.Add(newClass);
 }
 public void ChangeId(int value, Class c)
 {
     this.Id = value;
     c.ValidateStudentEntries();
 }
Esempio n. 23
0
 public void Remove(Class oldClass)
 {
     this.classes.Remove(oldClass);
 }
Esempio n. 24
0
 public void RemoveClass(Class schoolClass)
 {
     this.schoolClasses.Remove(schoolClass);
 }
Esempio n. 25
0
        static void Main(string[] args)
        {
            School penchoSlaveikov = new School("Pencho Slaveikov");

            Class mathClass = new Class("12A");
            penchoSlaveikov.AddClass(mathClass);
            Class artClass = new Class("12B");
            penchoSlaveikov.AddClass(artClass);

            #region All Students
            Student[] students = 
            {
                new Student("Pesho", 1),  
                new Student("Minka", 2),
                new Student("Goshko", 3),
                new Student("Stavri", 4),
                new Student("Penka", 5),
                new Student("Slavka", 6),
                new Student("Dimcho", 7),
                new Student("Pencho", 8),
                new Student("Simo", 9),
                new Student("Giga", 10),
                new Student("Aishe", 11),
            };
            #endregion

            #region All Disciplines
            Discipline mathematics = new Discipline("Mathematics", 3, 10);
            Discipline physics = new Discipline("Physics", 5, 15);
            Discipline geography = new Discipline("Geography", 2, 8);
            Discipline music = new Discipline("Music", 3, 6);
            Discipline english = new Discipline("English", 6, 12);
            Discipline drawing = new Discipline("Drawing", 2, 4);
            Discipline chemistry = new Discipline("Chemistry", 4, 8);
            #endregion

            #region All Teachers
            List<Teacher> teachers = new List<Teacher>()
            {
                new Teacher("Georgiev"),
                new Teacher("Minkov"),
                new Teacher("Ivanov"),
                new Teacher("Panaiotoa"),
                new Teacher("Ignatova")
            };
            #endregion

            teachers[0].AddDiscipline(mathematics);
            teachers[0].AddDiscipline(physics);
            teachers[1].AddDiscipline(chemistry);
            teachers[1].AddDiscipline(physics);
            teachers[2].AddDiscipline(english);
            teachers[3].AddDiscipline(geography);
            teachers[4].AddDiscipline(music);
            teachers[4].AddDiscipline(drawing);

            mathClass.AddStudents(new List<Student>() 
            { 
                students[0], students[1], students[2], students[3], students[4], students[5] 
            });

            artClass.AddStudents(new List<Student>() 
            { 
                students[6], students[7], students[8], students[9], students[10] 
            });

            mathClass.AddTeachers(new List<Teacher>() { teachers[0], teachers[1], teachers[2] });
            artClass.AddTeachers(new List<Teacher>() { teachers[2], teachers[3], teachers[4] });

            #region Print on console
            Console.WriteLine("School: " + penchoSlaveikov);
            Console.Write("Classes: ");
            foreach (var clas in penchoSlaveikov.Classes)
            {
                Console.Write(clas + " ");
            }
            Console.WriteLine();

            Console.WriteLine();
            Console.WriteLine("Teachers in " + mathClass.UniqueId + ":");
            foreach (var teacher in mathClass.Teachers)
            {
                Console.WriteLine(teacher + " - teaches: " + teacher.Disciplines);
            }

            Console.WriteLine();
            Console.WriteLine("Teachers in " + artClass.UniqueId + ":");
            foreach (var teacher in artClass.Teachers)
            {
                Console.WriteLine(teacher + " - teaches: " + teacher.Disciplines);
            }

            Console.WriteLine();
            Console.WriteLine("Students in " + mathClass.UniqueId + ":");
            foreach (var student in mathClass.Students)
            {
                Console.WriteLine(student);
            }

            Console.WriteLine();
            Console.WriteLine("Students in " + artClass.UniqueId + ":");
            foreach (var student in artClass.Students)
            {
                Console.WriteLine(student);
            }
            #endregion
        }