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


C# School.AddSchoolClass方法代码示例

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


在下文中一共展示了School.AddSchoolClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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