static void Main() { //Students Student firstStudent = new Student("Pesho", "Kamburov", 1); Student secondStudent = new Student("Galin", "Imamov", 2); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("Students:"); Console.ResetColor(); Console.WriteLine(firstStudent.ToString()); Console.WriteLine(secondStudent.ToString()); //Teachers Teacher firstTeacher = new Teacher("Stefan", "Popov"); firstTeacher.AddDiscipline(new Discipline("Math", 16, 10)); firstTeacher.AddDiscipline(new Discipline("Physics", 20, 5)); Teacher secondTeacher = new Teacher("Armin", "Van Buuren"); secondTeacher.AddDiscipline(new Discipline("TechMusic", 15, 5)); secondTeacher.AddDiscipline(new Discipline("Minimal", 18, 7)); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("\nTeachers:"); Console.ResetColor(); Console.WriteLine(firstTeacher.ToString()); Console.WriteLine(secondTeacher.ToString()); //School School school = new School(); school.AddClass(new Class("12b", firstTeacher)); school.AddClass(new Class("12a", secondTeacher)); }
static void Main() { var disciplineOne = new Disciplines("Math", 4, 4); var disciplineTwo = new Disciplines("Literature", 5, 5); var disciplineThree = new Disciplines("History", 6, 6); var teacherOne = new Teacher("Gosho"); var teacherTwo = new Teacher("Gosho2"); var teacherThree = new Teacher("Gosho3"); teacherOne.AddDiscipline(disciplineOne); teacherOne.AddDiscipline(disciplineTwo); teacherTwo.AddDiscipline(disciplineThree); teacherThree.AddDiscipline(disciplineOne); teacherThree.AddDiscipline(disciplineThree); var studentOne = new Student("tosho"); var studentTwo = new Student("penka"); var studentThree = new Student("stamat"); var myClass = new Class("The mad class"); myClass.AddStudent(studentOne); myClass.AddStudent(studentTwo); myClass.AddStudent(studentThree); myClass.AddTeacher(teacherOne); myClass.AddTeacher(teacherTwo); myClass.AddTeacher(teacherThree); myClass.PrintInfo(); }
static void Main() { //Students Student firstStudent = new Student("Pesho", "Kamburov", 1); Student secondStudent = new Student("Galin", "Imamov", 2); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("Students:"); Console.ResetColor(); Console.WriteLine(firstStudent.ToString()); Console.WriteLine(secondStudent.ToString()); //Teachers Teacher firstTeacher = new Teacher("Stefan", "Popov"); firstTeacher.AddDiscipline(new Discipline("Math", 16, 10)); firstTeacher.AddDiscipline(new Discipline("Physics", 20, 5)); Teacher secondTeacher = new Teacher("Armin", "Van Buuren"); secondTeacher.AddDiscipline(new Discipline("TechMusic", 15, 5)); secondTeacher.AddDiscipline(new Discipline("Minimal", 18, 7)); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("\nTeachers:"); Console.ResetColor(); Console.WriteLine(firstTeacher.ToString()); Console.WriteLine(secondTeacher.ToString()); //School School school = new School(); school.AddClass(new Class("12b", firstTeacher)); school.AddClass(new Class("12a", secondTeacher)); }
//01. We are given a school. In the school there are //classes of students. Each class has a set of teachers. //Each teacher teaches a set of disciplines. Students have //name and unique class number. Classes have unique text identifier. //Teachers have name. Disciplines have name, number of lectures and //number of exercises. Both teachers and students are people. Students, //classes, teachers and disciplines could have optional comments (free text block). //Your task is to identify the classes (in terms of OOP) and their attributes //and operations, encapsulate their fields, define the class hierarchy and create //a class diagram with Visual Studio. static void Main() { School PMG = new School("PMG"); ClassOfStudents _11a = new ClassOfStudents("11 A"); Student pesho = new Student("Pesho", 1); Student gosho = new Student("Gosho", 2); _11a.AddStudent(pesho); _11a.AddStudent(gosho); Discipline math = new Discipline("Mathematics", 5, 10); Discipline physics = new Discipline("Physics", 5, 15); Teacher rangelova = new Teacher("Rangelova"); rangelova.AddComment("Az imam kozi"); rangelova.AddDiscipline(math); rangelova.AddDiscipline(physics); _11a.AddStudent(pesho); _11a.AddStudent(gosho); _11a.AddTeacher(rangelova); PMG.AddClass(_11a); }
static void Main() { School scholl = new School("MG Petar Beron"); SchoolClass schClass = new SchoolClass("4a"); scholl.AddSchoolClass(schClass); Student student = new Student("Anna Dimova", 1); schClass.AddStudent(student); student = new Student("Biljana Asenova", 2); schClass.AddStudent(student); student = new Student("Georgi Ivanov", 3); schClass.AddStudent(student); student = new Student("Emil Stojanov", 4); schClass.AddStudent(student); Teacher teacherMath = new Teacher("Radka Petrova"); Discipline discipline = new Discipline("Mathematics", 5, 2); teacherMath.AddDiscipline(discipline); discipline = new Discipline("Informatics", 3, 2); teacherMath.AddDiscipline(discipline); schClass.AddTeacher(teacherMath); Teacher teacherChem = new Teacher("Stojanka Stojanova"); discipline = new Discipline("Chemistry", 5, 2); teacherChem.AddDiscipline(discipline); schClass.AddTeacher(teacherChem); Teacher teacherEng = new Teacher("Ivo Nikolov"); discipline = new Discipline("Englich", 3, 1); teacherEng.AddDiscipline(discipline); schClass = new SchoolClass("4b"); scholl.AddSchoolClass(schClass); student = new Student("Angel Dimov", 1); schClass.AddStudent(student); student = new Student("Bojan Ivanov", 2); schClass.AddStudent(student); student = new Student("Georgi Stojanov", 3); schClass.AddStudent(student); student = new Student("Emilija Dimova", 4); schClass.AddStudent(student); schClass.AddTeacher(teacherMath); schClass.AddTeacher(teacherChem); schClass.AddTeacher(teacherEng); Console.WriteLine(scholl); }
static public void TestMethod() { Discipline math = new Discipline("Math", 1, 1); Discipline programming = new Discipline("Programming", 2, 2); List <Discipline> disciplines = new List <Discipline>(); disciplines.Add(math); disciplines.Add(programming); Teacher teacher = new Teacher("Ivan", disciplines); Console.WriteLine(teacher); teacher.AddDiscipline(new Discipline()); Console.WriteLine(teacher); teacher.RemoveDiscipline(math); Console.WriteLine(teacher); teacher.Disciplines = new List <Discipline>(); Console.WriteLine(teacher); teacher.Live(); }
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()); }
static void Main() { List <IPerson> people = new List <IPerson>(); SchoolClass schoolClass = new SchoolClass("FirstClass", 2); Student pesho = new Student(2, "Pesho", "Very good student!"); Teacher gosho = new Teacher("Gosho"); Discipline disciplina = new Discipline("Mathematics", 4, 4); Discipline disciplina2 = new Discipline("Biology", 4, 5); gosho.AddDiscipline(disciplina); gosho.AddDiscipline(disciplina2); people.Add(pesho); people.Add(gosho); foreach (var item in people) { Console.WriteLine(item); } }
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()); }
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); }
private static void Main() { var firstDiscipline = new Discipline("Mathematic", 20, 3, "Some comment for math..."); var secondDiscipline = new Discipline("Physics", 22, 4); var firstTeacher = new Teacher("Georgi Gerogiev", "Some comment for the teacher..."); var secondTeacher = new Teacher("Ivan Ivanov"); firstTeacher.AddDiscipline(null); firstTeacher.GetDisciplines().ForEach(x => System.Console.WriteLine(x.Name)); firstTeacher.AddDiscipline(secondDiscipline); secondTeacher.AddDiscipline(firstDiscipline); secondTeacher.AddDiscipline(secondDiscipline); var firstStudent = new Student("Pesho Peshov", 112, "Some comment about the student..."); var secondStudent = new Student("Gosho Goshov", 113); var exampleSchoolClass = new School("Some unique ID", "Some comment..."); exampleSchoolClass.AddStudent(firstStudent); exampleSchoolClass.AddStudent(secondStudent); exampleSchoolClass.AddTeacher(firstTeacher); exampleSchoolClass.AddTeacher(secondTeacher); }