/// <summary> /// Add an array of teachers to the class /// </summary> /// <param name="teachersInfo"></param> public void AddTeachers(Teacher[] teachersInfo) { foreach (var teacher in teachersInfo) { this.classTeachers.Add(teacher); } }
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); }
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); }
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"; }
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() { //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() { 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); }
public SchoolClass(string unqID, Teacher[] teachers, Student[] students) { this.uniqueTextId = unqID; this.commentOfClass = string.Empty; setOfStudents = new List<Student>(); setOfTeachers = new List<Teacher>(); foreach (var teacher in teachers) { setOfTeachers.Add(teacher); } foreach (var student in students) { setOfStudents.Add(student); } }
private static void Main() { var discip = new[] { new Discipline("Math", 10, 5), new Discipline("History", 8, 2) }; var teacher1 = new Teacher("Pesho Petrov", discip, "Test comment"); var teacher2 = new Teacher("Gandalf The Grey", discip); Console.WriteLine(teacher1); var student1 = new Student("Pesho Hristov", 13, "Tapak"); var student2 = new Student("Foobar Foobarov", 54, "Genius"); var test = new SchoolClass("12-g", new[] { student1, student2 }, new[] { teacher1, teacher2 }); Console.WriteLine(test); }
//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; }
static void Main() { School school = new School("NPMG"); List<Disciple> disciplines = LoadDisciplines(); Teacher dimo = new Teacher("Dimo Padalski", disciplines); Course geography = new Course("Geography"); geography.AddTeacher(dimo); school.AddCourse(geography); Teacher dimo2 = new Teacher("Dimo Padalski II", disciplines); Course geography2 = new Course("Geography2"); geography2.AddTeacher(dimo2); school.AddCourse(geography2); Console.WriteLine(PrintSchoolInfo(school)); }
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 }); }
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); }
public static void Main() { Student dwayne = new Student("Pesho", "Peshov", 6); Console.WriteLine("Student name: {0}, Class number: {1}", dwayne.ToString(), dwayne.ClassNumber); Teacher firstTeacher = new Teacher( "Ivan", "Petkov", new Discipline("Math", 15, 20), new Discipline("Art", 10, 12)); Console.WriteLine(firstTeacher.ToString()); Teacher secondTeacher = new Teacher( "The", "Rock", new Discipline("Sports", 30, 40)); School newSchool = new School( new Class("12a", firstTeacher), new Class("12b", secondTeacher)); }
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() { Student stdFirst = new Student("Snejko", 12); Student stdSecond = new Student("Bai Spiro", 1); Student stdThird = new Student("Kashchei Bezsmurtni", 99); Discipline disciplFirst = new Discipline("Combene na jenki", 1, 1); Discipline disciplSecond = new Discipline("Grebane s lujica", 10, 10); Discipline disciplThird = new Discipline("Sky Diving", 10, 0); List<Discipline> bobTheTurboObjects = new List<Discipline>(); bobTheTurboObjects.Add(disciplFirst); bobTheTurboObjects.Add(disciplSecond); bobTheTurboObjects.Add(disciplThird); Teacher teacherFirst = new Teacher("Bobi Turboto", bobTheTurboObjects); Console.WriteLine("The only one teacher in the school is: " + teacherFirst.TeacherName + ". Imagine what kind of school is that !"); Console.WriteLine("Bobi Turboto lectures students on these disciplines: "); foreach (Discipline discipline in teacherFirst.TeacherObjects) { Console.WriteLine(); Console.WriteLine(discipline.ObjectName); } }
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 }); }
public void RemoveTeacher(Teacher teacher) { if (!setOfTeachers.Contains(teacher)) { throw new ArgumentException("There is no such teacher!"); } else { setOfTeachers.Remove(teacher); } }
public void AddTeacher(Teacher teacher) { if (setOfTeachers.Contains(teacher)) { throw new ArgumentException("Existing teacher"); } else { setOfTeachers.Add(teacher); } }
public void RemoveTeacher(Teacher teacher) { this.Teachers.Remove(teacher); }
public void AddTeacher(Teacher teacher) { this.Teachers.Add(teacher); }
private static void Main() { List<Student> students = new List<Student> { new Student("Ivan", "11"), new Student("Boril", "11"), new Student("Hristo", "11"), new Student("Svetla", "21"), new Student("Joro", "21"), new Student("Elena", "21"), new Student("Mira", "31"), new Student("Stoil", "31"), new Student("Todor", "31"), new Student("Draan", "12"), new Student("Pesho", "12"), new Student("Gosho", "12"), new Student("Mariela", "22"), new Student("Jordan", "22"), new Student("Ginka", "22"), new Student("Sneja", "32"), new Student("Stamat", "32"), new Student("Todor", "32") }; Console.WriteLine("Student Objects :"); students.ForEach(x => Console.WriteLine("{0} {1}", x.Name, x.ClassNumb)); Console.WriteLine(); List<Discipline> disciplines = new List<Discipline>() { new Discipline("PHP basics", 10, students.FindAll(student => student.ClassNumb.Equals("11"))), new Discipline("JavaScript basics", 10, students.FindAll(student => student.ClassNumb.Equals("21"))), new Discipline("C# basics", 10, students.FindAll(student => student.ClassNumb.Equals("31"))), new Discipline("JavaScript OOP", 10, students.FindAll(student => student.ClassNumb.Equals("12"))), new Discipline("PHP OOP", 10, students.FindAll(student => student.ClassNumb.Equals("22"))), new Discipline("C# OOP", 10, students.FindAll(student => student.ClassNumb.Equals("32"))) }; Discipline phpBasics = new Discipline("PHP basics", 10, students.FindAll(student => student.ClassNumb.Equals("11"))); Discipline javaScriptBasics = new Discipline("JavaScript basics", 10, students.FindAll(student => student.ClassNumb.Equals("21"))); Discipline cSharpBasics = new Discipline("C# basics", 10, students.FindAll(student => student.ClassNumb.Equals("31"))); Discipline javaScriptOop = new Discipline("JavaScript OOP", 10, students.FindAll(student => student.ClassNumb.Equals("12"))); Discipline phpOop = new Discipline("PHP OOP", 10, students.FindAll(student => student.ClassNumb.Equals("22"))); Discipline cSharpOop = new Discipline("C# OOP", 10, students.FindAll(student => student.ClassNumb.Equals("32"))); Console.WriteLine("Discipline Objects :"); disciplines.ForEach(disc => disc.DisciplineStudents.ForEach(student => Console.WriteLine("{0} {1}", disc.DisciplineName, student.Name))); Console.WriteLine(); List<Teacher> teachers = new List<Teacher> { new Teacher("Gospodinov", new List<Discipline>() { phpBasics, javaScriptBasics }), new Teacher("Draganov", new List<Discipline>(){ cSharpBasics, cSharpOop}), new Teacher("Chervenkov", new List<Discipline>(){ phpOop, javaScriptBasics}), new Teacher("Sharanov", new List<Discipline>(){ javaScriptOop, cSharpBasics}) }; Teacher gospodinov = new Teacher("Gospodinov", new List<Discipline>() { phpBasics, javaScriptBasics }); Teacher draganov = new Teacher("Draganov", new List<Discipline>(){ cSharpBasics, cSharpOop}); Teacher chervenkov = new Teacher("Chervenkov", new List<Discipline>(){ phpOop, javaScriptBasics}); Teacher sharanov = new Teacher("Sharanov", new List<Discipline>(){ javaScriptOop, cSharpBasics}); List<Class> classes = new List<Class> { new Class("A1", teachers.Where(teacher => teacher.Disciplines.Any(disc => disc.DisciplineName.EndsWith("basics"))).ToList()), new Class("A2", teachers.Where(teacher => teacher.Disciplines.Any(disc => disc.DisciplineName.EndsWith("OOP"))).ToList()) }; Console.WriteLine("Class Objects : "); classes.ForEach(clas => clas.ClassTeachers .ForEach(teacher => teacher.Disciplines .ForEach(discipline => Console.WriteLine("{0} - {1} : {2}", clas.ClassIndentifier, teacher.Name, discipline.DisciplineName)))); }
public void AddTeacher(string name, Discipline[] disciplines) { Teacher teacher = new Teacher(name, disciplines); teachers.Add(teacher); }
//methods //add teacher public void AddTeacher(Teacher teacher) { SetOfTeachers.Add(teacher); }
public SchoolClass(string unqID, Teacher[] teachers, Student[] students, string comment) : this(unqID, teachers, students) { this.commentOfClass = comment; }
public void RemoveTeacher(string name, Discipline[] disciplines) { Teacher teacher = new Teacher(name, disciplines); teachers.Remove(teacher); }
public void AddTeacher(Teacher tch) { this.teachers.Add(tch); }
public void AddTeacher (Teacher newTeacher) { this.Teachers.Add(newTeacher); }
public void DeleteTeacher(Teacher teacher) { this.teachers.Remove(teacher); }
public void WantToRetire(Teacher t, string reason) { MessageBox.Show(reason); }