本文整理汇总了C#中School.AddAClassInTheSchool方法的典型用法代码示例。如果您正苦于以下问题:C# School.AddAClassInTheSchool方法的具体用法?C# School.AddAClassInTheSchool怎么用?C# School.AddAClassInTheSchool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类School
的用法示例。
在下文中一共展示了School.AddAClassInTheSchool方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}