示例#1
0
        public static void Main()
        {
            var stoyanov = new Student("Stoyanov", "54443AZ");
            var petrov = new Student("Petrov", "54444AZ", "no like");
            var mimi = new Student("Mimi", "55221RX", "very cute");

            var students = new List<Student> { stoyanov, petrov, mimi };
            

            var teachers = new List<Teacher> { new Teacher("Gadiov"), new Teacher("Ivanov"), new Teacher("Georgiev") };
            teachers[1].Detail = "The best teacher ever";

            foreach (var teacher in teachers)
            {
                Console.WriteLine("Teacher: " + teacher.Name);
            }

            foreach (var student in students)
            {
                Console.WriteLine("Student: " + student.Name + " - " + student.UniqueClassNum + " - " + student.Detail);
            }

            var history = new Discipline("History", new List<Student>() { stoyanov, petrov, mimi}, 25);
            var mechanics = new Discipline("Mechanics", new List<Student>() { mimi, petrov }, 53, "important discipline");

            var class19A = new SchoolClass("19A", students, teachers);

            var mySchool = new School(new List<SchoolClass>() { class19A });
        }
示例#2
0
        public static void Main()
        {
            Student pesho = new Student("Pesho", "201411V21", "very tallented, self-critical");
            Student misho = new Student("Misho", "201411V13");

            // Student gatyo = new Student("Gosho", "201411V13"); // should throw exception
            Student gosho = new Student("Gosho", "201412V13");
            Student katya = new Student("Katya", "201412V19", "likes litterature, expecially indian novels of Karl May");

            Discipline maths = new Discipline("Mathematics", new List <Student>()
            {
                pesho, gosho, misho
            }, 35);
            Discipline litterature = new Discipline("Litterature", new List <Student>()
            {
                gosho, misho, katya
            }, 15, "optional");
            Discipline informatics = new Discipline("Informatics", new List <Student>()
            {
                pesho, gosho, katya, misho
            }, 50, "main discipline");

            Teacher peshova = new Teacher("Peshova", new List <Discipline>()
            {
                litterature
            });
            Teacher dushkov = new Teacher("Dushkov", new List <Discipline>()
            {
                maths, informatics
            });

            SchoolClass class201411V = new SchoolClass("201411V", new List <Student>()
            {
                pesho, misho
            }, new List <Teacher>()
            {
                peshova
            });

            // below row should throw exception
            // SchoolClass class201412 = new SchoolClass("201411V", new List<Student>() { }, new List<Teacher>() { peshova, dushkov });
            SchoolClass class201412V = new SchoolClass("201412V", new List <Student>()
            {
            }, new List <Teacher>()
            {
                peshova, dushkov
            });

            School eg = new School(new List <SchoolClass>()
            {
                class201411V, class201412V
            });
        }
        static void Main()
        {
            // Student jack = new Student("Jack", "123456"); // should throw an exception - classNumber is not unique
            Student monica = new Student("Monica", "100096", "excellent student");
            Student ross = new Student("Ross", "100097", "very interested in history");
            Student joey = new Student("Joey", "100098", "takes acting classes");
            Student phoebe = new Student("Phoebe", "100099", "takes music classes");
            Student chandler = new Student("Chandler", "100100", "makes inappropriate jokes all the time");
            Student rachel = new Student("Rachel", "100101", "very interested in fashion");
            Student gunther = new Student("John", "1000102", "blonde");

            Discipline history = new Discipline("History", 40,
                new List<Student> { monica, ross, joey, phoebe, chandler, rachel, gunther }, "mandatory");
            Discipline music = new Discipline("Music", 15, new List<Student> { joey, phoebe, ross }, "optional");
            Discipline acting = new Discipline("Acting", 10, new List<Student> { joey, phoebe, gunther, monica }, "optional");
            Discipline literature = new Discipline("Literature", 40,
                new List<Student> { monica, ross, joey, phoebe, chandler, rachel, gunther }, "mandatory");

            Teacher geller = new Teacher("Geller", new List<Discipline> { history, literature });
            Teacher buffay = new Teacher("Buffay", new List<Discipline> { music, acting });

            SchoolClass testClass = new SchoolClass("Friends", new List<Teacher> { geller, buffay },
                new List<Student> { monica, ross, joey, phoebe, chandler, rachel, gunther }, "excellent class");
        }
示例#4
0
        public static void Main()
        {
            Student pesho = new Student("Pesho", "201411V21", "very tallented, self-critical");
            Student misho = new Student("Misho", "201411V13");

            // Student gatyo = new Student("Gosho", "201411V13"); // should throw exception
            Student gosho = new Student("Gosho", "201412V13");
            Student katya = new Student("Katya", "201412V19", "likes litterature, expecially indian novels of Karl May");

            Discipline maths = new Discipline("Mathematics", new List<Student>() { pesho, gosho, misho }, 35);
            Discipline litterature = new Discipline("Litterature", new List<Student>() { gosho, misho, katya }, 15, "optional");
            Discipline informatics = new Discipline("Informatics", new List<Student>() { pesho, gosho, katya, misho }, 50, "main discipline");

            Teacher peshova = new Teacher("Peshova", new List<Discipline>() { litterature });
            Teacher dushkov = new Teacher("Dushkov", new List<Discipline>() { maths, informatics });

            SchoolClass class201411V = new SchoolClass("201411V", new List<Student>() { pesho, misho }, new List<Teacher>() { peshova });

            // below row should throw exception
            // SchoolClass class201412 = new SchoolClass("201411V", new List<Student>() { }, new List<Teacher>() { peshova, dushkov });
            SchoolClass class201412V = new SchoolClass("201412V", new List<Student>() { }, new List<Teacher>() { peshova, dushkov });

            School eg = new School(new List<SchoolClass>() { class201411V, class201412V });
        }