static void Main() { //instantiate class SchoolClass schoolClass = new SchoolClass("1234"); //add students schoolClass.AddStudent(new Student("Mariana Dimitrova", "20")); schoolClass.AddStudent(new Student("Ivan Ivanov", "21")); schoolClass.AddStudent(new Student("Maria Ivanova", "22")); schoolClass.AddStudent(new Student("Dimitur Dimitrov", "23")); Console.WriteLine("--------------------------------"); //add teachers Teacher one = new Teacher("Ms Ivanova"); one.AddDiscipline(new Discipline("Biology", 30, 30)); Teacher two = new Teacher("Ms Dimitrova"); two.AddDiscipline(new Discipline("Geography", 30, 30)); two.AddDiscipline(new Discipline("History", 30, 20)); schoolClass.AddTeacher(one); schoolClass.AddTeacher(two); schoolClass.AddTeacher(one); Console.WriteLine("--------------------------"); Console.WriteLine("------------------------"); schoolClass.PrintStudents(); Console.WriteLine("-----------------"); schoolClass.PrintTeachers(); Console.WriteLine("------------------"); schoolClass.AddComment("comment"); schoolClass.AddComment("second comment"); Console.WriteLine("Comments of the class:"); schoolClass.ViewComments(); }
static void Main() { List<Student> students = new List<Student>() { new Student("Angel Angelov", 22, 9002120011,1), new Student("Vasil Ivanov", 22, 9012121212, 2), new Student("Nikolay Niklov", 22, 9012200014, 3), new Student("Nikolina Jekova", 22, 9011141113, 4), new Student("Julia Ribarska", 22, 9005132259, 5) }; students[3].Comment = "Play games during the class hour"; SchoolClass schoolClass = new SchoolClass("7 A"); foreach (var student in students) { schoolClass.AddStudent(student); } List<Discipline> disciplines = new List<Discipline>() { new Discipline("Computer architectures", 20, 10), new Discipline("Programin languages", 20, 10), new Discipline("Mangement of new technologies", 20, 10), new Discipline("Operating systems", 30, 15), }; foreach (var discipline in disciplines) { schoolClass.AddDiscipline(discipline); } List<Teacher> teachers = new List<Teacher>() { new Teacher("Ivan Peshev", 60, 4301010012), new Teacher("Peter Petrov", 50, 5311121112) }; teachers[0].AddDiscipline(disciplines[0]); teachers[0].AddDiscipline(disciplines[1]); teachers[1].AddDiscipline(disciplines[2]); teachers[1].AddDiscipline(disciplines[3]); foreach (var teacher in teachers) { schoolClass.AddTeacher(teacher); } School school = new School("The Alien Education"); school.AddClass(schoolClass); Console.WriteLine(school); Console.WriteLine(); Console.ResetColor(); }
// Add SchoolClass to the list public void AddSchoolClass(SchoolClass schoolClass) { if (schoolClass == null) { throw new ArgumentNullException("School parameter is Null!"); } this.schoolClasses.Add(schoolClass); }
static void Main() { #region CREATE TEST OBJ //discipline List<Disciplines> disciplines = new List<Disciplines>(); disciplines.Add(new Disciplines("Chemistry", 4, 6)); disciplines.Add(new Disciplines("Math", 10, 10)); disciplines.Add (new Disciplines("Biology", 8, 6)); disciplines.Add(new Disciplines("Insurance", 10, 6)); disciplines.Add(new Disciplines("Informatics", 10, 16)); //teachers List<Teacher> teachers = new List<Teacher>(); teachers.Add(new Teacher("Manolov",disciplines.GetRange(3,1))); teachers.Add(new Teacher("Minkov",disciplines.GetRange(0,2))); teachers.Add(new Teacher("Marinov", disciplines.GetRange(2, 1))); teachers.Add(new Teacher("Ovcharov", disciplines.GetRange(0, 3))); //students List<Student> students = new List<Student>(); students.Add(new Student("Martin", 3)); students.Add(new Student("Darin", 13)); students.Add(new Student("Rumqna", 6)); students.Add(new Student("Emil", 33)); students.Add(new Student("Nikola", 7)); students.Add(new Student("Georgi", 1)); //SchoolClasses List<SchoolClass> schoolClasses = new List<SchoolClass>(); schoolClasses.Add(new SchoolClass(teachers, students, "3133")); //school School school = new School("School Akademy",schoolClasses); #endregion //-----TEST SCHOOL------- Console.WriteLine(school); #region TEST OPTIONAL COMMENTS Student vasko = new Student("Vasko",3); vasko.FreeComments = "OPTIONAL COMMENT TEST"; vasko.ShowFreeComments(); Teacher ra = new Teacher("Vasko", disciplines); ra.FreeComments = "OPTIONAL COMMENT TEST"; ra.ShowFreeComments(); SchoolClass da = new SchoolClass(teachers,students,"31231"); da.FreeComments = "OPTIONAL COMMENT TEST"; da.ShowFreeComments(); #endregion }
// Remove SchoolClass from the list public bool RemoveSchoolClass(SchoolClass schoolClass) { if (schoolClass == null) { throw new ArgumentNullException("School parameter is Null!"); } if (!this.schoolClasses.Contains(schoolClass)) { return(false); } return(this.schoolClasses.Remove(schoolClass)); }
// Remove SchoolClass from the list public bool RemoveSchoolClass(SchoolClass schoolClass) { if (schoolClass == null) { throw new ArgumentNullException("School parameter is Null!"); } if (!this.schoolClasses.Contains(schoolClass)) { return false; } return this.schoolClasses.Remove(schoolClass); }
static void Main(string[] args) { var class1 = new SchoolClass(); var class2 = new SchoolClass(); var class3 = new SchoolClass(); var student1 = new Student("asd"); var student2 = new Student("aggd"); var student3 = new Student("vxvxv"); Console.WriteLine(class1.TextId); Console.WriteLine(class2.TextId); Console.WriteLine(class3.TextId); Console.WriteLine(student1.UniqueId); Console.WriteLine(student2.UniqueId); Console.WriteLine(student3.UniqueId); }
static void Main() { School school = new School(); SchoolClass schoolClass = new SchoolClass("A"); school.AddClass(schoolClass); Console.WriteLine(schoolClass); Teacher teacher = new Teacher("Ivan Ivanov"); teacher.AddDiscipline(new Discipline("Literature", 4, 4)); schoolClass.AddTeacher(teacher); teacher = new Teacher("Petko Petkov"); teacher.AddComment("Cool!"); teacher.AddComment("Nice guy!"); teacher.AddDiscipline(new Discipline("Music", 20, 10)); schoolClass.AddTeacher(teacher); Console.WriteLine(schoolClass.GetTeachers()); Student student = new Student("Jon", 7); }
static void Main(string[] args) { Teacher testTeacher = new Teacher("Mr. Burnes", new List <Discipline>() { new Discipline("History", 5, 5), new Discipline("Math", 6, 4) }); Student testStudentOne = new Student("Ivan Ivanov", 2156); Student testStudentTwo = new Student("Georgi Petrov", 2015); SchoolClass testSchoolClass = new SchoolClass("Computer Science", new List <Teacher>() { testTeacher }); School testSchool = new School(new List <SchoolClass>() { testSchoolClass }); testStudentOne.AddComment("Scored A in Object Oriented Programming"); testStudentOne.AddComment("Scored D in Calculus"); // Uncomment next line to print Teacher // Console.WriteLine(testTeacher); // Uncomment next two lines to print two students // Console.WriteLine(testStudentOne); // Console.WriteLine(testStudentTwo); // Uncomment next line to print SchoolClass // Console.WriteLine(testSchoolClass); // Uncomment next line to print School // Console.WriteLine(testSchool); // Uncomment next line to print comments for first student // testStudentOne.PrintComments(); }
public static void School() { //creating instances of Student class Student angel = new Student("Angel Dragomirov", 1); Student ivan = new Student("Ivan Dragomirov", 11); Student georgi = new Student("Georgi Haralampiev", 7); //creating instances of Teacher class Teacher petrov = new Teacher("Kiril Petrov"); Teacher ivanov = new Teacher("Marian Ivanov"); //Adding techers knowledge disciplines petrov.Subjects.Add(Discipline.Math); petrov.Subjects.Add(Discipline.Chemistry); ivanov.Subjects.Add(Discipline.AmericanEnglish); ivanov.Subjects.Add(Discipline.BritishEnglish); //creating instance of SchoolClass class SchoolClass AClass = new SchoolClass("AClass"); //adding Students to the SchoolClass AClass.Students.Add(angel); AClass.Students.Add(ivan); AClass.Students.Add(georgi); //adding Teacher to the SchoolClass AClass.Teachers.Add(petrov); AClass.Teachers.Add(ivanov); //creating instance of School School mySchool = new School(51, "Elisaveta Bagryana"); //adding SchoolClass to the School mySchool.Classes.Add(AClass); //adding optional comment AClass.About = "Geeks"; }
//Methods public void AddClass(SchoolClass schoolClass) { this.Classes.Add(schoolClass); }
public void RemoveClass(SchoolClass schoolClass) { this.schoolClasses.Remove(schoolClass); }
public void RemoveClass(SchoolClass schoolClass) { this.Classes.Remove(schoolClass); }
public void AddClass(SchoolClass shoolClass) { this.Classes.Add(shoolClass); }