public static void Main() { var school = new School(); var newClass = new Class("3"); school.AddClass(newClass); Console.WriteLine(newClass.Name); var someStudent = new Student("Pesho", "252525"); var anotherStudent = new Student("Gosho", "252526"); newClass.AddPeople(someStudent); newClass.AddPeople(anotherStudent); var someTeacher = new Teacher("Cura"); newClass.AddPeople(someTeacher); var discipline = new Discipline("Mathematics", 10, 20); someTeacher.AddDiscipline(discipline); Console.WriteLine(discipline.Name); foreach (var person in newClass.People) { Console.WriteLine(person.Name); } someStudent.AddComment("Will you have a lecture tomorrow?"); anotherStudent.AddComment("No, The teacher is ill!"); Console.WriteLine("Student: {0}\nUnique Number: {1}", someStudent.Name, someStudent.UniqueClassNumber); foreach (var comment in someStudent.Comments) { Console.WriteLine("Comments: {0}", comment); } someStudent.RemoveComment("Will you have a lecture tomorrow?"); }
static void Main(string[] args) { Student peshoStudent = new Student("Petar Petrov", 17); Student goshoStudent = new Student("Georgi Georgiev", 5); Student mimiStudent = new Student("Maria Petrova", 12); Student geriStudent = new Student("Gergana Georgieva", 7); Student ivanStudent = new Student("Ivan Ivanov", 10); ivanStudent.AddComment("Nevertheless..."); Discipline maths = new Discipline("Mathematics", 3, 3); Discipline phy = new Discipline("Physics", 2, 2); Discipline info = new Discipline("Informatics", 2, 2); Discipline chem = new Discipline("Chemistry", 1, 1); Discipline eng = new Discipline("English", 2, 2); Teacher haralampiTeacher = new Teacher("Haralampi Haralampiev", new List<Discipline> { maths, info }); Teacher gospodinTeacher = new Teacher("Gospodin Gospodinov", new List<Discipline> { eng, maths }); Teacher dimoTeacher = new Teacher("Dimo Dimov", new List<Discipline> { phy, chem }); Class elevenA = new Class("11A", new List<Teacher>{gospodinTeacher, dimoTeacher}); Class elevenB = new Class("11B", new List<Teacher>{haralampiTeacher, dimoTeacher}); School ourSchool = new School(new List<Class>{ elevenA, elevenB }); Console.WriteLine(ivanStudent); ivanStudent.PrintComment(); Console.WriteLine(dimoTeacher); Console.WriteLine(elevenA); Console.WriteLine(ourSchool); }
static void Main() { Student student = new Student("John Doe", 4); Console.WriteLine(student); Teacher teacher = new Teacher("Jeff Black", new Discipline("Chemistry",10,20),new Discipline("Physics",15,25)); Console.WriteLine(teacher); School school = new School(new SchoolClass("12b", teacher)); }
static void Main() { // Even with empty constructors so defined class functionalitites can be tested var newSchoolClass = new SchoolClass(); Console.WriteLine(newSchoolClass); var newStudent = new Student(); Console.WriteLine(newStudent); var newTeacher = new Teacher(); Console.WriteLine(newTeacher); }
static void Main() { Disciplines[] subjectsArr = new Disciplines[]{ new Disciplines("Sport", 1, 2), new Disciplines("Science", 4, 2), new Disciplines("Italian", 3, 3), }; Student[] arrStudents = new Student[]{ new Student("Andy" , 1), new Student("Mike" , 3), new Student("William" , 7), new Student("Maria" , 16), new Student("Sofia" , 17), }; Teacher[] setOfteachers = new Teacher[]{ new Teacher("Cassius Clay", new List<Disciplines>{subjectsArr[0], subjectsArr[1]}), new Teacher("Bar Rafaeli", new List<Disciplines>{subjectsArr[2], subjectsArr[1]}), }; // Creating a new class Classes wildlings = new Classes("Wildlings"); // Adding students wildlings.AddManyStudentToClass(arrStudents[0], arrStudents[1], arrStudents[2] , arrStudents[3], arrStudents[4]); // Adding teachers wildlings.AddTeacherToClass(setOfteachers[0]); wildlings.AddTeacherToClass(setOfteachers[1]); // Adding disciplines wildlings.AddDisciplineToClass(subjectsArr[0]); wildlings.AddDisciplineToClass(subjectsArr[1]); wildlings.AddDisciplineToClass(subjectsArr[2]); // Adding Comments arrStudents[0].Comment = "Misses classes quite often"; setOfteachers[1].Comment = "Best teacher in school"; wildlings.Comment = "Very poor discipline and marks"; // To string Method + Comments Console.WriteLine("ToString() student -> {0};\nComment: {1}\n" , arrStudents[0], arrStudents[0].Comment); Console.WriteLine("ToString() teacher -> {0};\nComment: {1}\n" , setOfteachers[1], setOfteachers[1].Comment); Console.WriteLine("ToString() class -> {0};\nComment: {1}\n" , wildlings, wildlings.Comment); }
static void Main() { School oldSchool = new School("How High Highscool"); Class classOne = new Class("A1"); Class classTwo = new Class("A2"); Class classThree = new Class("B1"); Teacher teacherOne = new Teacher("Gerasim", "an old ba*tard!"); Teacher teacherTwo = new Teacher("Gerasimov"); Student studentOne = new Student("Ivan", "123456", "ladies type"); Student studentTwo = new Student("Petkan", "123457", "zubar1"); Student studentThree = new Student("Gosho", "123458"); Student studentFour = new Student("Krasimir", "123459", "pich"); Student studentFive = new Student("Ivan", "0000001"); Discipline chovekIPriroda = new Discipline("CIP", 5, 10); Discipline history = new Discipline("History", 3, 6, "...the story of it all "); Discipline geography = new Discipline("Geography", 3, 6); Discipline literature = new Discipline("Literature", 2, 4, "Russian classics basically"); oldSchool.AddClass(classOne); oldSchool.AddClass(classTwo); oldSchool.AddClass(classThree); teacherOne.AddDiscipline(chovekIPriroda); teacherOne.AddDiscipline(literature); teacherTwo.AddDiscipline(history); teacherTwo.AddDiscipline(geography); classOne.AddStudentToAClass(studentOne); classOne.AddStudentToAClass(studentTwo); classTwo.AddStudentToAClass(studentThree); classThree.AddStudentToAClass(studentFour); classThree.AddStudentToAClass(studentFive); classOne.AddTeacherToAClass(teacherOne); classOne.AddTeacherToAClass(teacherTwo); classTwo.AddTeacherToAClass(teacherOne); classThree.AddTeacherToAClass(teacherTwo); Console.WriteLine("The school {0} has {1} the fololing classes: \n\n {2} {3} {4}", oldSchool.Name, oldSchool.Classes.Count, classOne, classTwo, classThree); }
// Add Students public void AddStudentToClass(Student student) { this.classStudents.Add(student); }
//Methods public void AddStudentToAClass(Student student) { this.students.Add(student); }
public void RemoveStudent(Student student) { this.setOfStudents.Remove(student); }
public void AddStudent(Student student) { this.setOfStudents.Add(student); }