static void Main()
        {
            Disciplines[] subjectsArr = new Disciplines[]{
                new Disciplines("Sport", 1, 2),
                new Disciplines("Science", 4, 2),
                new Disciplines("Italian", 3, 3),
            };

            Student[] arrStudents = new Student[]{
                new Student("Andy" , 1),
                new Student("Mike" , 3),
                new Student("William" , 7),
                new Student("Maria" , 16),
                new Student("Sofia" , 17),
            };

            Teacher[] setOfteachers = new Teacher[]{
                new Teacher("Cassius Clay", new List<Disciplines>{subjectsArr[0], subjectsArr[1]}),
                new Teacher("Bar Rafaeli", new List<Disciplines>{subjectsArr[2], subjectsArr[1]}),
            };

            // Creating a new class
            Classes wildlings = new Classes("Wildlings");

            // Adding students
            wildlings.AddManyStudentToClass(arrStudents[0], arrStudents[1], arrStudents[2]
                , arrStudents[3], arrStudents[4]);

            // Adding teachers
            wildlings.AddTeacherToClass(setOfteachers[0]);
            wildlings.AddTeacherToClass(setOfteachers[1]);

            // Adding disciplines
            wildlings.AddDisciplineToClass(subjectsArr[0]);
            wildlings.AddDisciplineToClass(subjectsArr[1]);
            wildlings.AddDisciplineToClass(subjectsArr[2]);

            // Adding Comments
            arrStudents[0].Comment = "Misses classes quite often";
            setOfteachers[1].Comment = "Best teacher in school";
            wildlings.Comment = "Very poor discipline and marks";

            // To string Method + Comments
            Console.WriteLine("ToString() student -> {0};\nComment: {1}\n"
                , arrStudents[0], arrStudents[0].Comment);
            Console.WriteLine("ToString() teacher -> {0};\nComment: {1}\n"
                , setOfteachers[1], setOfteachers[1].Comment);
            Console.WriteLine("ToString() class -> {0};\nComment: {1}\n"
                , wildlings, wildlings.Comment);
        }
        static void Main()
        {
            Teacher teach = new Teacher("Zlatka", "Ivanova");
            teach.AddDiscipline(new Disciplines("matematika", 1, 14)); //asign discipline to teacher
            teach.AddDiscipline(new Disciplines("Fizika", 2, 15));

            Teacher teacherIvan = new Teacher("Ivan", "Ivanov", new Disciplines("Math", 5, 14));
            teacherIvan.AddDiscipline(new Disciplines("Phisycs", 5, 15));

            Students studentIvan = new Students("Pavel","Ivanov");
            Students studentPeho = new Students("Petar", "Petrov");
            Classes class1 = new Classes(teach, studentIvan, "46153689");
            class1.AddStudent(studentPeho);

            Console.WriteLine(class1);
            Console.WriteLine("==========================================");

            Console.WriteLine(teach);
            Console.WriteLine(teacherIvan);
        }
        static void Main()
        {
            // Creating school
            School telerik = new School("Telerik Academy");

            // Creating disciplines
            Disciplines csharp1 = new Disciplines("C# part 1: ", 7, 10);
            Disciplines csharp2 = new Disciplines("C# part 2: ", 8, 10);
            Disciplines csharpOOP = new Disciplines("C# OOP: ", 6, 10);
            Disciplines csharpHQC = new Disciplines("C# High-Quality Code: ", 20, 40);
            Disciplines csharDSA = new Disciplines("C# Data Structures and Algorithms: ", 15, 25);

            telerik.AddDisciplines(csharp1);

            // Creating teachers
            Teachers doncho = new Teachers("Doncho Minkov");
            Teachers niki = new Teachers("Nikolay Kostov");

            // telerik.AddTeachers(doncho);
            // doncho.AddDisciplines(csharp1);

            List<Teachers> cSharpTeachers = new List<Teachers>() {doncho, niki};

            Classes first = new Classes("First Group");
            Classes second = new Classes("Second Group");

            // telerik.AddClasses(first);
            // first.AddTeachers(doncho);

            // Creating students
            Students vili = new Students("Vili", 1);
            Students kris = new Students("Kristian", 2);
            Students mitko = new Students("Dimitar", 3);
            Students gosho = new Students("Georgi", 4);

            // Add comment
            vili.AddComment("kris");
            vili.PrintComment();

            Console.WriteLine(telerik);
        }
Exemple #4
0
 public void AddClasses(Classes clas)
 {
     listClasses.Add(clas);
 }
Exemple #5
0
 public void AddClasses(Classes clas)
 {
     listClasses.Add(clas);
 }
        public static void Main()
        {
            School someSchool = new School("School");
            Console.WriteLine("School name: \"{0}\"\n", someSchool.NameOfSchool);

            var listOfStudents = new List<Student>()
            {
                new Student ("Angel Geshev", "Class A"),
                new Student ("Deqn Balev", "Class A"),
                new Student ("Angel Marinov", "Class A"),
                new Student ("Boris Voinikov", "Class A"),
                new Student ("Galin Ivanov", "Class B"),
                new Student ("Zasmqn Zasmqnov", "Class B"),
                new Student ("Iglika Cvetanova", "Class B"),
                new Student ("Minka Breznikova", "Class B"),
                new Student ("Mariq Aleksandrova", "Class B")
            };

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

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

            List<Student> studentsInClassA = new List<Student>();
            studentsInClassA.Add(listOfStudents[0]);
            studentsInClassA.Add(listOfStudents[1]);
            studentsInClassA.Add(listOfStudents[2]);
            studentsInClassA.Add(listOfStudents[3]);

            List<Student> studentsInClassB = new List<Student>();
            studentsInClassB.Add(listOfStudents[4]);
            studentsInClassB.Add(listOfStudents[5]);
            studentsInClassB.Add(listOfStudents[6]);
            studentsInClassB.Add(listOfStudents[7]);
            studentsInClassB.Add(listOfStudents[8]);

            Discipline math = new Discipline("Math", 10, 10);
            Discipline bulgarianLanguage = new Discipline("Bulgarian language", 20, 15);
            Discipline sport = new Discipline("Sport", 5, 5);
            Discipline physics = new Discipline("Physics", 5, 5);
            Discipline biology = new Discipline("Biology", 10, 10);

            Teacher mitkoKolev = new Teacher("Mitko Kolev");
            mitkoKolev.Disciplines.Add(math);
            mitkoKolev.Disciplines.Add(physics);

            Teacher elenaGeorgieva = new Teacher("Elena Georgieva");
            elenaGeorgieva.Disciplines.Add(bulgarianLanguage);

            Teacher stamatStamatov = new Teacher("Stamat Stamatov");
            stamatStamatov.Disciplines.Add(biology);
            stamatStamatov.Disciplines.Add(sport);

            List<Teacher> teachersForAClass = new List<Teacher>() { mitkoKolev, stamatStamatov };
            List<Teacher> teachersForBClass = new List<Teacher>() { elenaGeorgieva, mitkoKolev };

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

            foreach (Teacher teacher in teachersForAClass)
            {
                Console.WriteLine("{0} {1}", teacher.Name, string.Join("\n", teacher.Disciplines));
                Console.WriteLine();
            }

            Classes classA = new Classes("Class A", studentsInClassA);
            classA.Teachers = teachersForAClass;

            Classes classB = new Classes("Class B", studentsInClassB);
            classB.Teachers = teachersForBClass;

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

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

            classA.AddComment("Hi!");
            classA.AddComment("Bye!");
        }