internal static void Main() { var firstStudent = new Student("Gosho", "Goshov", 1234); var secondStudent = new Student("Ivan", "Ivanov", 123456); var thirdStudent = new Student("Pesho", "Peshov", 12345678); var firstDiscipline = new Disciplines("Math", 12, 36); var secondDiscipline = new Disciplines("English", 28, 56); var thirdDiscipline = new Disciplines("Biology", 4, 12); var firstTeacher = new Teacher("Ginka", "Ginkova"); var secondTeacher = new Teacher("Manol", "Manolov"); var thirdTeacher = new Teacher("Grisho", "Grishov"); var firstClass = new Class("XII A"); var secondClass = new Class("VI B"); var thirdClass = new Class("III D"); firstTeacher.AddDiscipline(firstDiscipline); firstTeacher.AddDiscipline(secondDiscipline); firstTeacher.AddDiscipline(thirdDiscipline); firstClass.AddStudent(firstStudent); firstClass.AddTeacher(firstTeacher); //Prints// firstStudent.Print(); firstDiscipline.Print(); firstTeacher.Print(); firstClass.Print(); }
static void Main() { Student pesho = new Student("Pesho", 8); Student gosho = new Student("Gosho", 8, "kaval"); Teacher stamatov = new Teacher("Stamatov", "bastun"); Teacher petrova = new Teacher("Petrova"); Class myClass = new Class("A"); myClass.AddStudent(pesho); myClass.AddStudent(gosho); myClass.AddTeacher(stamatov); myClass.AddTeacher(petrova); Discipline biologia = new Discipline("biologia", 30, 30); Discipline matematika = new Discipline("matematika", 40, 40, "cool"); stamatov.AddDiscipline(biologia); petrova.AddDiscipline(matematika); for (int i = 0; i < myClass.Students.Count; i++) { Console.WriteLine(myClass.Students[i].Name); } Console.WriteLine(); myClass.RemoveStudent(pesho); for (int i = 0; i < myClass.Students.Count; i++) { Console.WriteLine(myClass.Students[i].Name); } Console.WriteLine(); for (int i = 0; i < myClass.Teachers.Count; i++) { Console.WriteLine(myClass.Teachers[i].Name); } myClass.RemoveTeacher(petrova); Console.WriteLine(); for (int i = 0; i < myClass.Teachers.Count; i++) { Console.WriteLine(myClass.Teachers[i].Name); } stamatov.AddDiscipline(matematika); Console.WriteLine(); for (int i = 0; i < stamatov.Disciplines.Count; i++) { Console.WriteLine(stamatov.Disciplines[i].NameOfDiscipline); } }
public static void Run() { Student aniPetrova = new Student("Ani", " Petrova", 1); Student gerogiMalinov = new Student("Gerogi", " Malinov", 2); Student hristoVasilev = new Student("Hristo ", "Vasilev", 3); List <Student> studentsInClassA = new List <Student>(); studentsInClassA.Add(aniPetrova); studentsInClassA.Add(gerogiMalinov); studentsInClassA.Add(hristoVasilev); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("School Classes Tests"); Console.ForegroundColor = ConsoleColor.White; foreach (var student in studentsInClassA) { Console.WriteLine(student.ToString()); } Console.WriteLine(); Discipline math = new Discipline("Math", 10, 10); Discipline language = new Discipline("Language", 20, 10); Discipline art = new Discipline("Art", 5, 10); Teacher petarPetrov = new Teacher("Petar", " Petrov"); petarPetrov.AddDiscipline(math); petarPetrov.AddDiscipline(language); Teacher peshoPeshov = new Teacher("Pesho", "Peshov"); peshoPeshov.AddDiscipline(art); List <Teacher> teachersForAClass = new List <Teacher>() { petarPetrov, peshoPeshov }; Class classA = new Class("5A"); classA.AddTeacher(petarPetrov); classA.AddTeacher(peshoPeshov); Console.WriteLine(classA.ToString() + "\n" + string.Join(", ", classA.Teachers)); Console.WriteLine(); // classA.AddComment("Hello"); /// uncoment to Thro exception classA.AddComment("Welcome! This is our first class."); classA.AddComment("This is our last class! Good Bye!"); }
static void Main() { Console.WriteLine("Small Test:"); Student mara = new Student("Mara", 55); Student pesho = new Student("Pesho", 44); Teacher joro = new Teacher("Joro"); Discipline math = new Discipline("Mathematics", 15, 4); joro.AddDiscipline(math); SchoolClass myClass = new SchoolClass("1a"); myClass.AddStudent(mara); myClass.AddStudent(pesho); myClass.AddTeacher(joro); Console.WriteLine(myClass); try { SchoolClass myClass2 = new SchoolClass("1a"); } catch (ArgumentException e) { Console.WriteLine(e.Message); } try { Student gosho = new Student("Gosho", 44); } catch (ArgumentException e) { Console.WriteLine(e.Message); } }
public static void Main() { Classes classes = new Classes("5B"); classes.AddPerson(new Teacher("Slavka Todorova")); classes.AddPerson(new Teacher("Velichka Taseva")); classes.AddPerson(new Teacher("Roza Georgieva")); classes.AddPerson(new Teacher("Maria Asenova")); classes.AddPerson(new Student("Emilia Filcheva", classes.ClassID)); classes.AddPerson(new Student("Anelia Koleva", classes.ClassID)); string[] disciplinesNames = { "English", "Math", "French", "Biology", "Chemistry", "Geography", "History" }; int count = -1; foreach (var person in classes.People) { count++; if (count == disciplinesNames.Length) { count = count % disciplinesNames.Length; } if (person is Teacher) { Teacher teacher = person as Teacher; teacher.AddDiscipline(disciplinesNames[count], count + 1, (count + 1) * 2); } Console.WriteLine(person.ToString()); } }
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); }
public static School CreateSchool(string schoolName) { var school = new School(schoolName); var csharp = new Course("C#"); var oop = new Course("OOP"); var html = new Course("HTML"); var toshoGoshov = new Teacher("Tosho", "Goshov"); var goshoPeshov = new Teacher("Gosho", "Peshov"); var mishoToshov = new Teacher("Misho", "Toshov"); var csharpDiscipline = new Discipline("C#", 20, 20); var oopDiscipline = new Discipline("OOP", 10, 10); var htmlDiscipline = new Discipline("HTML", 5, 5); toshoGoshov.AddDiscipline(csharpDiscipline); goshoPeshov.AddDiscipline(csharpDiscipline); goshoPeshov.AddDiscipline(oopDiscipline); mishoToshov.AddDiscipline(htmlDiscipline); var mimiKostova = new Student("Mimi", "Kostova", 123); var didiPeshova = new Student("Didi", "Peshova", 567); var sisiGoshova = new Student("Sisi", "Goshova", 587); csharp.AddTeacher(toshoGoshov); csharp.AddTeacher(goshoPeshov); oop.AddTeacher(goshoPeshov); html.AddTeacher(mishoToshov); csharp.AddStudent(mimiKostova); oop.AddStudent(mimiKostova); html.AddStudent(sisiGoshova); html.AddStudent(didiPeshova); school.AddCourse(csharp); school.AddCourse(oop); school.AddCourse(html); mimiKostova.AddComment(new Comment("Team Project", "Awesome teammate!", didiPeshova)); oop.AddComment(new Comment("OOP Principles", "Huh?", sisiGoshova)); return(school); }
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); }
static void Main() { Student peshoPeshov = new Student("Pesho", "Peshov", 1); Student iliqPetkov = new Student("Iliq", "Petkov", 2); Student ivanDraganov = new Student("Ivan", "Draganov", 3); List <Student> studentsInClassA = new List <Student>(); studentsInClassA.Add(peshoPeshov); studentsInClassA.Add(iliqPetkov); studentsInClassA.Add(ivanDraganov); foreach (var student in studentsInClassA) { Console.WriteLine(student.ToString()); } Console.WriteLine(); Discipline math = new Discipline("Math", 10, 10); Discipline language = new Discipline("Language", 20, 10); Discipline art = new Discipline("Art", 5, 10); Teacher dinkoPetrov = new Teacher("Dinko", "Petrov"); dinkoPetrov.AddDiscipline(math); dinkoPetrov.AddDiscipline(language); Teacher penkaHubavenkova = new Teacher("Penka", "Hubavenkova"); penkaHubavenkova.AddDiscipline(art); List <Teacher> teachersForAClass = new List <Teacher>() { dinkoPetrov, penkaHubavenkova }; Class classA = new Class("10A"); classA.AddTeacher(dinkoPetrov); classA.AddTeacher(penkaHubavenkova); Console.WriteLine(classA.ToString() + "\n" + string.Join(", ", classA.Teachers)); }
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); }
static void Main() { Teacher teacher1 = new Teacher("Vanya", "Karaasenova"); Teacher teacher2 = new Teacher("Maya", "Dobreva"); teacher1.AddDiscipline(new Discipline("Chemistry", 12, 10)); teacher1.AddDiscipline(new Discipline("Sport", 7, 5)); Console.WriteLine("Teachers details:"); Console.WriteLine(teacher1.ToString()); Console.WriteLine(teacher2.ToString()); Class testClass = new Class("12"); testClass.AddDiscipline(new Discipline("Chemistry", 12, 10)); teacher2.AssignGroup(testClass); foreach (Discipline discipline in testClass.Disciplines) { Console.WriteLine(discipline.ToString()); } }
static void Main() { Student aniPetrova = new Student("Ani"," Petrova", 1); Student gerogiMalinov = new Student("Gerogi"," Malinov",2); Student hristoVasilev = new Student("Hristo ","Vasilev",3); List<Student> studentsInClassA = new List<Student>(); studentsInClassA.Add(aniPetrova); studentsInClassA.Add(gerogiMalinov); studentsInClassA.Add(hristoVasilev); foreach (var student in studentsInClassA) { Console.WriteLine(student.ToString()); } Console.WriteLine(); Discipline math = new Discipline("Math", 10, 10); Discipline language = new Discipline("Language", 20, 10); Discipline art = new Discipline("Art", 5, 10); Teacher petarPetrov = new Teacher("Petar"," Petrov"); petarPetrov.AddDiscipline (math); petarPetrov.AddDiscipline(language); Teacher peshoPeshov = new Teacher("Pesho" ,"Peshov"); peshoPeshov.AddDiscipline(art); List<Teacher> teachersForAClass = new List<Teacher>() { petarPetrov, peshoPeshov }; Class classA = new Class("5A"); classA.AddTeacher(petarPetrov); classA.AddTeacher(peshoPeshov); Console.WriteLine(classA.ToString() + "\n" + string.Join("", classA.TeachersSet)); classA.AddComment("Hello"); classA.AddComment("This is our first class."); classA.AddComment("This is our last class!"); }
static void Main() { Class newClass = new Class(); Teacher ivan = new Teacher("Ivan Ivanov"); Teacher petar = new Teacher("Petar Petrov"); newClass.AddTeacher(ivan); newClass.AddTeacher(petar); Discipline maths = new Discipline("Maths", 4, 4); Discipline physics = new Discipline("Physics", 2, 3); ivan.AddDiscipline(maths); ivan.AddDiscipline(physics); petar.AddDiscipline(maths); Console.WriteLine(newClass); foreach (var teacher in newClass.Teachers) { Console.WriteLine(teacher); teacher.showDisciplines(); } Console.WriteLine(); Student petya = new Student("Petya Petkova"); Student mariya = new Student("Mariya Petkova"); Student tanya = new Student("Tanya Petkova"); newClass.AddStudent(petya); newClass.AddStudent(mariya); newClass.AddStudent(tanya); foreach (var item in newClass.Students) { Console.WriteLine(item); } }
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()); }
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)}"); }