示例#1
0
        static void Main()
        {
            Student goshkoStudent = new Student("Goshko", 5);
            goshkoStudent.AddComment("Goshko is a bad student.");

            Student peshoStudent = new Student("Pesho", 10);
            peshoStudent.AddComment("Pesho is a normal student.");

            Student ivanStudent = new Student("Ivan", 11);
            ivanStudent.AddComment("Ivan is a great student.");

            Discipline maths = new Discipline("Maths", 10, 10);
            Discipline physics = new Discipline("Physics", 5, 4);

            Teacher teacher = new Teacher("Borislav Petrov", new List<Discipline>() { maths, physics });
            teacher.AddComment("Borislav Petrov is a very good teacher.");
            teacher.AddComment("Wonderful teacher.");
            teacher.AddComment("Teaches only useful and interesting things.");

            //test comments methods
            teacher.ShowComments();
            Console.WriteLine();

            teacher.RemoveComment("Wonderful teacher.");
            //the comments after removed one comment
            teacher.ShowComments();

            //clear all comments and after that nothing happens
            teacher.ClearAllComments();
            teacher.ShowComments();

            Class newClass = new Class("123", new List<Teacher>() { teacher }, new List<Student>() { goshkoStudent, peshoStudent, ivanStudent });

            School school = new School(new List<Class>() { newClass });
        }
示例#2
0
        public static void Main()
        {
            Discipline firstDiscipline = new Discipline("history", 2, 5);
            Discipline secondDiscipline = new Discipline("math", 8, 4);

            Student firstStudent = new Student("Daniel", 1);
            Student secondStudent = new Student("Ivan", 2);

            Teacher firstTeacher = new Teacher("Petrov", new List<Discipline> { firstDiscipline, secondDiscipline });

            Class firstClass = new Class("1A", new List<Student> { firstStudent, secondStudent }, new List<Teacher> { firstTeacher });

            School firstSchool = new School(new List<Class> { firstClass });

            Console.WriteLine("The name of the first discipline of the first teacher in 1A class is: {0}",firstSchool.Classes[0].Teachers[0].SetOfDisciplines[0].Name);
            
            firstSchool.Classes[0].Comment = "The best students ever!";
            Console.WriteLine(firstSchool.Classes[0].Comment);
        }
        static void Main(string[] args)
        {
            Student pesho = new Student("Pesho",1234);
            Student mariika = new Student("Mariika",1235);
            mariika.Details = "Keep eyes on her, is very horny !";
            Discipline cSharp = new Discipline("C#",2,pesho,mariika);

            Teacher nakov = new Teacher("Svetlin Nakov",cSharp);
            Teacher vlado = new Teacher("Vlado Karamfilov", cSharp);

            Class firstLevel = new Class(nakov, "Level 2");

            IHuman[] allPeopleInSchool = new IHuman[] {  vlado, pesho, mariika, nakov};

            var sortedPpl = allPeopleInSchool.OrderBy(p => p.GetType() == typeof(Student)).ThenBy(p=>p.Name).ToList();

            //Console.WriteLine(mariika.Name +" Number "+ mariika.UniqueClassNumber +" Details: "+mariika.Details);
            foreach (var ppl in sortedPpl)
            {
                //Sorted By Teachers then Students
                Console.WriteLine(ppl.Name);
            }
            Console.WriteLine();
        }
示例#4
0
 public void RemoveClass(Class oldClass)
 {
     this.classes.Remove(oldClass);
 }
示例#5
0
 // Methods
 public void AddClass(Class newClass)
 {
     this.classes.Add(newClass);
 }