当前位置: 首页>>代码示例>>C#>>正文


C# Teacher.AddDiscipline方法代码示例

本文整理汇总了C#中Teacher.AddDiscipline方法的典型用法代码示例。如果您正苦于以下问题:C# Teacher.AddDiscipline方法的具体用法?C# Teacher.AddDiscipline怎么用?C# Teacher.AddDiscipline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Teacher的用法示例。


在下文中一共展示了Teacher.AddDiscipline方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

    static void Main()
    {
        // == Disciplines ==
        Discipline math = new Discipline("Math", 23, 23);
        Discipline bio = new Discipline("Bio", 23, 34);
        Discipline geo = new Discipline("Geo", 27, 44);

        // == Teachers ==
        Teacher Dimitar = new Teacher("Dimitar Lilov", 34, Gender.Male);
        Dimitar.AddDiscipline(math);
        Dimitar.AddDiscipline(bio);

        Teacher Kiril = new Teacher("Kiril Nikolov", 29, Gender.Male);
        Kiril.AddDiscipline(geo);

        // == Students ==
        Student Aneliq = new Student("Aneliq Iordanova", 17, Gender.Female, 000354);
        Student Yoana = new Student("Yoana Ivanova", 18, Gender.Female, 000359);
        Yoana.AddComment("EGN - 2342623623");

        // == List Of Teachers ==
        List<Teacher> teachers = new List<Teacher>();
        teachers.Add(Dimitar);
        teachers.Add(Kiril);

        // == List Of Students ==
        List<Student> students = new List<Student>();
        students.Add(Aneliq);
        students.Add(Yoana);

        // == StudentClass ==
        StudentClass firstClass = new StudentClass("10B", students, teachers);

        // == School ==
        School washington = new School("Washington");
        washington.AddSchoolClass(firstClass);

        // == Printing ==
        Console.ForegroundColor = ConsoleColor.Green;
        Console.WriteLine("Printing School ...");
        Console.ResetColor();
        Console.WriteLine();
        Console.WriteLine(washington);

        Console.ForegroundColor = ConsoleColor.Green;
        Console.WriteLine("Printing Class ...");
        Console.ResetColor();
        Console.WriteLine();
        Console.WriteLine(firstClass);

        Console.ReadLine();
    }
开发者ID:BorislavIvanov,项目名称:Telerik_Academy,代码行数:52,代码来源:AppTest.cs

示例2: Main

    static void Main()
    {
        School hogwards = new School();

        Class blackMagic = new Class("Black Magic");

        Teacher snape = new Teacher("Snape");

        snape.Comments = "brrrrr";

        Discipline blackStuffPractise = new Discipline("Black stuff and dark stuff",1,200);
        blackStuffPractise.Comments = "brr";

        snape.AddDiscipline(blackStuffPractise);

        blackMagic.AddTeacher(snape);

        hogwards.AddClass(blackMagic);

        foreach (var clas in hogwards.Classes)
        {
            foreach (var teach in clas.Teachers)
            {
                foreach (var disc in teach.Disciplines)
                {
                    Console.WriteLine(disc.Name);
                }
            }
        }
    }
开发者ID:purlantov,项目名称:TelerikAcademy-4,代码行数:30,代码来源:SchoolTesting.cs

示例3: Main

        static void Main()
        {

            // Just examples :)
            School school = new School("Proffesional Economy College");

            Class firstClass = new Class("11 B");
            Class secondClass = new Class("10 A");
            Class thirdClass = new Class("12 D");

            Teacher firstTeacher = new Teacher("Pesho");
            Teacher secondTeacher = new Teacher("Gosho");

            Student firstStudent = new Student("Maria", "13");
            Student secondStudent = new Student("Penka", "2");
            Student thirdStudent = new Student("Blagoi", "32");
            Student forthStudent = new Student("Krasimir", "7");
            Student fifthStudent = new Student("Ivan", "15");

            Discipline math = new Discipline("Maths", 5, 10);
            Discipline history = new Discipline("History", 3, 6);
            Discipline geography = new Discipline("Geography", 3, 6);
            Discipline literature = new Discipline("Literature", 2, 4);

            school.AddClass(firstClass);
            school.AddClass(secondClass);
            school.AddClass(thirdClass);

            firstTeacher.AddDiscipline(math);
            firstTeacher.AddDiscipline(literature);
            secondTeacher.AddDiscipline(history);
            secondTeacher.AddDiscipline(geography);

            firstClass.AddStudentToAClass(firstStudent);
            firstClass.AddStudentToAClass(secondStudent);
            secondClass.AddStudentToAClass(thirdStudent);
            thirdClass.AddStudentToAClass(forthStudent);
            thirdClass.AddStudentToAClass(fifthStudent);

            firstClass.AddTeacherToAClass(firstTeacher);
            firstClass.AddTeacherToAClass(secondTeacher);
            secondClass.AddTeacherToAClass(firstTeacher);
            thirdClass.AddTeacherToAClass(secondTeacher);


            Console.WriteLine(school);
        }
开发者ID:Roshov,项目名称:Telerik-Software-Academy-,代码行数:47,代码来源:MainSchoolClasses.cs

示例4: Main

 private static void Main()
 {
     var firstDiscipline = new Discipline("Mathematic", 20, 3, "Some comment for math...");
     var secondDiscipline = new Discipline("Physics", 22, 4);
     var firstTeacher = new Teacher("Georgi Gerogiev", "Some comment for the teacher...");
     var secondTeacher = new Teacher("Ivan Ivanov");
     firstTeacher.AddDiscipline(firstDiscipline);
     firstTeacher.AddDiscipline(secondDiscipline);
     secondTeacher.AddDiscipline(firstDiscipline);
     secondTeacher.AddDiscipline(secondDiscipline);
     var firstStudent = new Student("Pesho Peshov", 112, "Some comment about the student...");
     var secondStudent = new Student("Gosho Goshov", 113);
     var exampleSchoolClass = new School("Some unique ID", "Some comment...");
     exampleSchoolClass.AddStudent(firstStudent);
     exampleSchoolClass.AddStudent(secondStudent);
     exampleSchoolClass.AddTeacher(firstTeacher);
     exampleSchoolClass.AddTeacher(secondTeacher);
 }
开发者ID:tdochev,项目名称:TelerikAcademy,代码行数:18,代码来源:Start.cs

示例5: Main

    static void Main()
    {
        School firstLanguageSchool = new School("First Language School");

        Discipline math = new Discipline("Basic Mathematics", 15, 11, "Kofti predmet");
        Discipline math2 = new Discipline("Mathematics 2-nd part", 14, 2);
        Console.WriteLine(math);

        Teacher first = new Teacher("Kolio", "Ivanov", "Idiot");
        first.AddDiscipline(math);
        first.AddDiscipline(math2);
        Console.WriteLine(first);

        Student firstStudent = new Student("Liolio", "Peshev", "Very poor performance", "11b");
        Console.WriteLine(firstStudent);

        SchoolClass eleven = new SchoolClass("Eleventh grade");
        eleven.AddTeacher(first);
    }
开发者ID:RuParusheva,项目名称:TelerikAcademy,代码行数:19,代码来源:Test.cs

示例6: Main

    static void Main()
    {
        IList<Student> students = new List<Student>
        {
            new Student("Георги Пешев", 1),
            new Student("Димитър Иванов", 2),
            new Student("Иван Цветанов", 5),
            new Student("Гергана Зафирова", 3),
            new Student("Стела Маринова", 4)
        };

        var html = new Discipline("HTML", 6);
        html.AddStudent(students[0]);
        html.AddStudent(students[2]);
        html.AddStudent(students[4]);
        html.Ditails = "Вечерни курсове";

        var css = new Discipline("CSS", 5);
        css.AddStudent(students[0]);
        css.AddStudent(students[1]);
        css.AddStudent(students[2]);

        var java = new Discipline("Java", 4);
        java.AddStudent(students[1]);
        java.AddStudent(students[3]);
        java.AddStudent(students[4]);

        var javaScript = new Discipline("JavaScript", 5,students);

        var webDevelopmentTeacher = new Teacher("Владимир Георгиев");
        webDevelopmentTeacher.AddDiscipline(html);
        webDevelopmentTeacher.AddDiscipline(css);
        webDevelopmentTeacher.AddDiscipline(javaScript);

        var JavaDevelopmentTeacher = new Teacher("Тодор Куртев");
        JavaDevelopmentTeacher.AddDiscipline(java);

        var classA = new Class("A", new List<Teacher> { webDevelopmentTeacher, JavaDevelopmentTeacher });

        string str = classA.ToString();
        Console.WriteLine(classA);

    }
开发者ID:ScreeM92,项目名称:Software-University,代码行数:43,代码来源:SchoolMainClass.cs

示例7: Main

        public static void Main()
        {
            Person p = new Person("Tosho", "Boshev");
            Console.WriteLine(p);

            Student s = new Student("Mitko", "Pitkov", 23);
            Console.WriteLine(s);

            Teacher t = new Teacher("Gosho", "Toshev");
            t.AddDiscipline(new Discipline("Mathematics", 20, 15));
            t.AddDiscipline(new Discipline("Geometry", 20, 25));
            t.AddDiscipline(new Discipline("Trigonometry", 25, 20));
            Console.WriteLine(t);

            Discipline d = new Discipline("Mathematics", 20, 15);
            Console.WriteLine(d);

            Class c = new Class("B");
            Console.WriteLine(c);
        }
开发者ID:AyrFX,项目名称:Telerik-Academy-2015-Object-Oriented-Programming-Homeworks,代码行数:20,代码来源:SchoolClassesMain.cs

示例8: Main

    static void Main()
    {
        Teacher firstTeacher = new Teacher("Doncho");
        Teacher secondTeacher = new Teacher("Nakov");
        Teacher thirdTeacher = new Teacher("Joro");
        Teacher fourthTeacher = new Teacher("Misho");

        firstTeacher.AddDiscipline("HTML", 6, 7);
        secondTeacher.AddDiscipline("CSharp", 6, 7);
        thirdTeacher.AddDiscipline("CSharp", 6, 7);
        fourthTeacher.AddDiscipline("HTML", 6, 7);

        List<Teacher> teachersTeam = new List<Teacher>()
        {
            firstTeacher,
            secondTeacher,
            thirdTeacher,
            fourthTeacher
        };


        Class firstClass = new Class(teachersTeam, "First class");
        Class secondClass = new Class(teachersTeam, "Second class");
        

        School testSchool = new School();
        testSchool.AddStudent("Ivo", 3423);
        testSchool.AddClass(firstClass);
        testSchool.AddClass(secondClass);

        Console.WriteLine("First student class number: {0}", testSchool.Students[0].ClassNumber);
        Console.WriteLine("First student name: {0}", testSchool.Students[0].Name);

        Console.WriteLine("Class Id: {0}", testSchool.Classes[0].TextId);
        Console.WriteLine("Second class, third teacher name: {0}", testSchool.Classes[1].Teachers[2].Name);

        testSchool.Students[0].Comment = "Cool";

        Console.WriteLine("Comment for {0}: {1}", testSchool.Students[0].Name, testSchool.Students[0].Comment);
    }
开发者ID:ScreeM92,项目名称:Software-University,代码行数:40,代码来源:TestClass.cs

示例9: Main

        static void Main()
        {
            //Instance of a school
            School mySchool = new School("125SOU");
            //Instance of a new teacher
            Teacher teach01 = new Teacher("Antonova");
            //Instance of a new discipline
            Discipline discipl01 = new Discipline(DisciplineName.Arts);
            //Add a discipline to teachers list - during this process you have to mark number of lectures and number of exercises
            teach01.AddDiscipline(discipl01);
            //instance of a new class
            Class myClass = new Class("first B");
            //Add this class to schools list
            mySchool.AddAClassInTheSchool(myClass);

            //Instance of another class - with the same name(identifier) - to check if it unique
            Class anotherClass = new Class("first B");
            //Add another class with the same identifier - the program will warn you and will ask to change this identifier
            mySchool.AddAClassInTheSchool(anotherClass);

            //Instance of a student
            Student stud01 = new Student("Petar");
            //Add this student to first class
            myClass.AddAStudent(stud01); //The program will ask for classnumber and will check if it unique

            //Instance of another student
            Student stud02 = new Student("Vania");
            myClass.AddAStudent(stud02); //Try to give this student the same class number as the first student

            //Add a teacher to a class
            myClass.AddATeacher(teach01);

            //Test adding comments
            mySchool.AddComment();
            teach01.AddComment();
        }
开发者ID:Bonevm01,项目名称:OOP_Principles1,代码行数:36,代码来源:SchoolTest.cs


注:本文中的Teacher.AddDiscipline方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。