static void Main() { Teacher teach = new Teacher("Zlatka", "Ivanova"); teach.AddDiscipline(new Disciplines("matematika", 1, 14)); //asign discipline to teacher teach.AddDiscipline(new Disciplines("Fizika", 2, 15)); Teacher teacherIvan = new Teacher("Ivan", "Ivanov", new Disciplines("Math", 5, 14)); teacherIvan.AddDiscipline(new Disciplines("Phisycs", 5, 15)); Students studentIvan = new Students("Pavel","Ivanov"); Students studentPeho = new Students("Petar", "Petrov"); Classes class1 = new Classes(teach, studentIvan, "46153689"); class1.AddStudent(studentPeho); Console.WriteLine(class1); Console.WriteLine("=========================================="); Console.WriteLine(teach); Console.WriteLine(teacherIvan); }
static void Main() { // Creating school School telerik = new School("Telerik Academy"); // Creating disciplines Disciplines csharp1 = new Disciplines("C# part 1: ", 7, 10); Disciplines csharp2 = new Disciplines("C# part 2: ", 8, 10); Disciplines csharpOOP = new Disciplines("C# OOP: ", 6, 10); Disciplines csharpHQC = new Disciplines("C# High-Quality Code: ", 20, 40); Disciplines csharDSA = new Disciplines("C# Data Structures and Algorithms: ", 15, 25); telerik.AddDisciplines(csharp1); // Creating teachers Teachers doncho = new Teachers("Doncho Minkov"); Teachers niki = new Teachers("Nikolay Kostov"); // telerik.AddTeachers(doncho); // doncho.AddDisciplines(csharp1); List<Teachers> cSharpTeachers = new List<Teachers>() {doncho, niki}; Classes first = new Classes("First Group"); Classes second = new Classes("Second Group"); // telerik.AddClasses(first); // first.AddTeachers(doncho); // Creating students Students vili = new Students("Vili", 1); Students kris = new Students("Kristian", 2); Students mitko = new Students("Dimitar", 3); Students gosho = new Students("Georgi", 4); // Add comment vili.AddComment("kris"); vili.PrintComment(); Console.WriteLine(telerik); }
public void AddStudent(Students student) { studentList.Add(student); }
//Constructor public Classes(Teacher teacher, Students student, string identifier) { this.Identifier = identifier; this.studentList.Add(student); this.teacher = teacher; }