static void Main() { var disciplines = LoadDisciplines(); School newSchool = new School("OU \"Yane Sandanski\""); newSchool.AddClass(new Class("1A")); newSchool.Classes[0].AddTeacher(new Teacher("Dora", "Chekanova", disciplines)); newSchool.Classes[0].AddTeacher(new Teacher("Mita", "Georgieva", disciplines)); newSchool.Classes[0].AddTeacher(new Teacher("Ivan", "Uzunov", disciplines)); newSchool.AddClass(new Class("1B")); newSchool.Classes[1].AddTeacher(new Teacher("Desislava", "Botseva", disciplines)); newSchool.Classes[1].AddTeacher(new Teacher("Elena", "Madjarova", disciplines)); newSchool.Classes[1].AddTeacher(new Teacher("Mariyana", "Dimitrova", disciplines)); Console.WriteLine("TEST FOR SCHOOL: \n" + newSchool); Class someClass = newSchool.Classes[0]; Console.WriteLine("TEST FOR CLASS: \n" + someClass); Teacher someTeacher = newSchool.Classes[1].Teachers[1]; Console.WriteLine("TEST FOR TEACHER: \n" + someTeacher); Console.WriteLine(); Discipline someDiscipline = newSchool.Classes[0].Teachers[0].Disciplines[2]; Console.WriteLine("TEST FOR DISCIPLINE: \n" + someDiscipline); Console.WriteLine(); Student someStudent = new Student("Ivan", "Vasilev", 13); Console.WriteLine("TEST FOR STUDENT: \n" + someStudent); Console.WriteLine(); Console.WriteLine("TEST FOR COMMENT FIELD: " + someStudent.Comment); someStudent.Comment = "{0} is the laziest student in the entire school!"; Console.WriteLine(); Console.WriteLine("TEST FOR COMMENT FIELD AFTER CHANGING THE TEXT: " + someStudent.Comment, someStudent.FirstName); }
public static void Main() { var firstDiscipline = new Discipline("HTML", 10, 10); var secondDiscipline = new Discipline("JavaScript", 25, 25); var thirdDiscipline = new Discipline("CSS", 15, 5); var fourthDiscipline = new Discipline("OOP", 15, 20); fourthDiscipline.AddComment("Best course ever"); var fifthDiscipline = new Discipline("C#", 20, 25); Teacher firstTeacher = new Teacher("Ivancho", firstDiscipline, secondDiscipline, thirdDiscipline); Teacher secondTeacher = new Teacher("Marcheto", secondDiscipline, fourthDiscipline); Teacher thirdTeacher = new Teacher("Bojana", fifthDiscipline, thirdDiscipline); thirdTeacher.AddComment("Very lazy"); Teacher fourthTeacher = new Teacher("Joreto", secondDiscipline, thirdDiscipline, fourthDiscipline, fifthDiscipline); Teacher fifthTeacher = new Teacher("Albena", fourthDiscipline, fifthDiscipline, secondDiscipline); Class classA = new Class("A", firstTeacher, secondTeacher, thirdTeacher); classA.AddComment("The best class of the academy"); Class classB = new Class("B", fourthTeacher, fifthTeacher); School telerikAcademy = new School(); telerikAcademy.AddClass(classA); telerikAcademy.AddClass(classB); }
public static void Main() { School school = new School("Test school"); Console.WriteLine("School name: \"{0}\"\n", school.Name); var students = new List<Student> { new Student("Pesho", 1, "Class leader"), new Student("Gosho", 2), new Student("Ivo", 3), new Student("Doncho", 4) }; Console.WriteLine("\nList of students: \n"); foreach (var student in students) { Console.WriteLine(student); } var disciplines = new List<Discipline> { new Discipline("Math", 15, 15) }; Discipline physics = new Discipline("Physics", 10, 10); disciplines.Add(physics); Console.WriteLine("\n\nList of disciplines:\n"); foreach (var discipline in disciplines) { Console.WriteLine(discipline); Console.WriteLine(); } Teacher peshov = new Teacher("Pesho Peshov", new List<Discipline>() { new Discipline("Physics", 10, 10) }); Teacher goshev = new Teacher("Gosho Goshev", new List<Discipline>() { new Discipline("Math", 10, 10) }); List<Teacher> teachers = new List<Teacher>() { peshov, goshev }; Console.WriteLine("\nList of teachers:\n"); foreach (Teacher teacher in teachers) { Console.WriteLine("{0} {1}", teacher.FullName, string.Join("\n", teacher.DisciplinesList)); Console.WriteLine(); } Class tenA = new Class("10 A", new List<Teacher>() { peshov }, new List<Student>() { new Student("Toshko", 1), new Student("Peshka", 2) }); Console.WriteLine("\nClass: "); Console.WriteLine(tenA); tenA.Comment = "Very good results last year!"; Console.WriteLine("\n\nClass \"{0}\" comment: {1}\n", tenA.ClassID,tenA.Comment); }
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() { //list of students var students = new List<Student>() { new Student("John", "Doe", 23840, 24, "male"), new Student("Jane", "Doe", 34653, 21, "female"), new Student("Alana", "Smith", 762342), }; //list of teachers var teachers = new List<Teacher>() { new Teacher("Brian", "Jones"), new Teacher("Zoe", "Ferguson"), new Teacher("Bob", "Bobson"), }; //adding disciplines teachers[0].AddDiscipline(new Discipline("Physics", 3, 4)); teachers[0].AddDiscipline(new Discipline("Mathematics", 4, 5)); teachers[1].AddDiscipline(new Discipline("Chemistry", 12, 5)); teachers[1].AddDiscipline(new Discipline("Literature", 8, 4)); teachers[2].AddDiscipline(new Discipline("Music", 8, 4)); //creating school with a class and adding teachers var school = new School(); school.AddClass(new Class("12A", teachers[0], teachers[1], teachers[2])); Console.WriteLine("Students: "); Console.WriteLine(new string('-', 30)); foreach (var student in students) { Console.WriteLine(student); } Console.WriteLine("Teachers: "); Console.WriteLine(new string('-', 30)); foreach (var teacher in teachers) { Console.WriteLine(teacher); } Console.WriteLine("School: "); Console.WriteLine(new string('-', 30)); Console.WriteLine(school); }
static void Main() { var school = new School("First English Language School"); var students = new List<Student> { new Student("Slim", "Shady", 45000), new Student("Doctor", "Dre", 45002), new Student("Snoop", "Dog", 45005), new Student("T", "Pain", 45009) }; var disciplines = new Dictionary<string, Discipline> { { "HTML", new Discipline("HTML", 5, 20) }, { "CSS", new Discipline("CSS", 5, 20) }, { "C#", new Discipline("C#", 12, 100) }, { "JavaScript", new Discipline("JavaScript", 12, 120) }, { "SQL", new Discipline("SQL", 4, 15) } }; var teachers = new List<Teacher> { new Teacher("Nikolay", "Kostov", new List<Discipline> { disciplines["C#"] }), new Teacher("Doncho", "Mitkov", new List<Discipline> { disciplines["JavaScript"], disciplines["CSS"] }), new Teacher("Ivaylo", "Kenov", new List<Discipline> { disciplines["C#"], disciplines["SQL"] }), new Teacher("Evlogy", "Georgiev", new List<Discipline> { disciplines["JavaScript"], disciplines["HTML"] }), }; var classes = new List<Class> { new Class("12D"), new Class("12V") }; foreach (var @class in classes) { school.AddClass(@class); } @classes[1].AddTeacher(teachers[2]); foreach (var @class in school.GetClasses()) { Console.WriteLine(@class); } classes[0].AddComment("This is a looooooooooong comment!"); Console.Write(classes[0].Comments); // feel free to test the other functionalities out }
/* 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 a name and unique class number. Classes have unique text identifier. Teachers have a name. Disciplines have a 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. */ 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() { 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() { List<Discipline> disciplines = new List<Discipline>(); List<Student> students = new List<Student>(); for (int i = 0; i < 15; i++) { disciplines.Add(new Discipline(string.Format("Discipline {0}", i + 1), i * 2 + 1, i * 3 + 2)); students.Add(new Student(string.Format("Pesho {0}{1}{0}", (char)(66 + i), (char)(65 + i)),i + 1)); } List<Teacher> teachers = new List<Teacher>() { new Teacher("Ivanka Petrova") { Disciplines = disciplines, Comment = "Pechena e :)"}, new Teacher("Gergana Ivanova") { Disciplines = {disciplines[0], disciplines[6], disciplines[8]}, Comment = "Stava :)"}, new Teacher("Poli Hristova") { Disciplines = {disciplines[4], disciplines[5], disciplines[7]}, Comment = "Losha :)"}, new Teacher("Velichka Andreeva") { Disciplines = {disciplines[8], disciplines[12], disciplines[14]}, Comment = "Stava :)"} }; Class myClass = new Class("8a", students, teachers); School mySchool = new School(); mySchool.Name = "Hristo Botev"; mySchool.Classes.Add(myClass); Console.WriteLine("School name: {0}", mySchool.Name); foreach (var pClass in mySchool.Classes) { Console.WriteLine(" Class: {0}", pClass.TextIdentifier); Console.WriteLine(" Students: "); foreach (var st in pClass.Students) { Console.WriteLine(" Name: {0}, Num: {1}", st.Name, st.ClassNumber); } Console.WriteLine(" Teachers: "); foreach (var teach in pClass.Teachers) { Console.WriteLine(" Name: {0}",teach.Name); Console.WriteLine(" Disciplines: "); foreach (var disc in teach.Disciplines) { Console.WriteLine(" {0} Lectures: {1}, Exercises: {2}", disc.Name, disc.NumLectures, disc.NumExercises); } } } }
static void Main() { List<Student> students = new List<Student> { new Student("Mihail Todorov", 20, "Male", 123123), new Student("Djordjano Ivanov", 25, "Male", 1010) }; List<Teacher> teachers = new List<Teacher> { new Teacher("Bistra Basheva", 70, "Female", new List<Discipline> { new Discipline("Electronics", 14, 0), new Discipline("Electronics - Practice", 0, 14)}), new Teacher("Daniel Alexandrov", 35, "Male", new List<Discipline> { new Discipline("History", 100, 0) }) }; List<SchoolClass> schoolclasses = new List<SchoolClass> { new SchoolClass("10B", students, teachers) }; School school = new School("ELSYS", schoolclasses); Console.WriteLine(school.ToString()); }
public static void Main() { var school = new School("PG Gen. Vl. Zaimov"); //students var ivan = new Student("Ivan Ivanov", 100011); var stoyan = new Student("Stoyan Stoyanov", 100012); var dragan = new Student("Dragan Draganov", 200011); var pesho = new Student("Pesho Peshov", 200012); //teachers var ivo = new Teacher("Ivaylo Kenov"); var niki = new Teacher("Nikolay Kostov"); var doncho = new Teacher("Doncho Minkov"); var evlogi = new Teacher("Evlogi Hristov"); //classes var firstClass = new SchoolClass("100"); var secondClass = new SchoolClass("200"); //disciplines var geography = new Discipline("Geography", 2, 2); var history = new Discipline("History", 1, 2); var biology = new Discipline("Biology", 3, 1); var math = new Discipline("Math", 3, 2); var mpt = new Discipline("MPT", 1, 3); //adding classes to school school.AddClass(firstClass); school.AddClass(secondClass); //adding teachers and students to classes firstClass.AddStudents(ivan); firstClass.AddStudents(stoyan); firstClass.AddTeachers(ivo); firstClass.AddTeachers(evlogi); secondClass.AddStudents(dragan); secondClass.AddStudents(pesho); secondClass.AddTeachers(doncho); secondClass.AddTeachers(niki); //adding disciplines to teachers ivo.AddDisciplines(geography); niki.AddDisciplines(biology); doncho.AddDisciplines(mpt); doncho.AddDisciplines(geography); ivo.AddDisciplines(history); evlogi.AddDisciplines(biology); ivan.Comment = "I like geography!"; doncho.Comment = "Something."; geography.Comment = "Surface of Earth......"; firstClass.Comment = "Advanced."; Console.WriteLine("{0, 28}", school); Console.WriteLine(new string('*', 40)); Console.WriteLine("Class identifier: {0}", firstClass); Console.WriteLine("\nStudents: \n{0}", firstClass.GetStudents()); Console.WriteLine("Teachers: \n{0}", firstClass.GetTeachers()); Console.WriteLine("Teacher's disciplines: "); Console.WriteLine("{0}\n{1}",ivo, ivo.GetDisciplines()); Console.WriteLine("{0}\n{1}", evlogi, evlogi.GetDisciplines()); Console.WriteLine("Comments:"); Console.WriteLine("{0}: {1}", ivan.Name, ivan.Comment); Console.WriteLine("{0}: {1}", geography.Name, geography.Comment); }
public static void Main() { School school = new School("Test School"); Console.WriteLine("School name: \"{0}\"\n", school.Name); var students = new List <Student> { new Student("Grafa", 1, "Class leader"), new Student("Mara", 2), new Student("Miro", 3), new Student("Lyubcho", 4) }; Console.WriteLine("\nList of students:\n"); foreach (var student in students) { Console.WriteLine(student); } var disciplines = new List <Discipline> { new Discipline("Maths", 15, 15) }; Discipline physics = new Discipline("Physics", 10, 10); disciplines.Add(physics); Console.WriteLine("\n\nList of disciplines:\n"); foreach (var discipline in disciplines) { Console.WriteLine(discipline); Console.WriteLine(); } Teacher petrova = new Teacher("Tsanka Petrova", new List <Discipline>() { new Discipline("Physics", 10, 10) }); Teacher pavlov = new Teacher("Tosho Pavlov", new List <Discipline>() { new Discipline("Maths", 10, 10) }); List <Teacher> teachers = new List <Teacher>() { petrova, pavlov }; Console.WriteLine("\nList of teachers:\n"); foreach (Teacher teacher in teachers) { Console.WriteLine("{0} {1}", teacher.FullName, string.Join("\n", teacher.DisciplinesList)); Console.WriteLine(); } Class tenA = new Class("10 A", new List <Teacher>() { petrova }, new List <Student>() { new Student("Todor", 1), new Student("Yana", 2) }); Console.Write("\nClass: "); Console.WriteLine(tenA); tenA.Comment = "Very good results last year!"; Console.WriteLine("\n\nClass \"{0}\" comment: {1}\n", tenA.ClassID, tenA.Comment); }
public static void Main() { School school = LoadSchool(); Console.WriteLine(PrintSchoolInfo(school)); }