本文整理汇总了C#中School.AddClass方法的典型用法代码示例。如果您正苦于以下问题:C# School.AddClass方法的具体用法?C# School.AddClass怎么用?C# School.AddClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类School
的用法示例。
在下文中一共展示了School.AddClass方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
//Student test
//Console.WriteLine("Student test");
List<Student> studentsList = new List<Student>();
studentsList.Add(new Student("Vesi", 1231532));
studentsList.Add(new Student("Natalia", 462346));
studentsList.Add(new Student("Mitko", 0982374));
//Console.WriteLine(studentsList.Print());
//Teacher test
//Console.WriteLine("Teacher test");
List<Teacher> teachersList = new List<Teacher>();
teachersList.Add(new Teacher("prof. Petrov"));
teachersList.Add(new Teacher("doc. Hristov"));
teachersList.Add(new Teacher("as. Doneva"));
teachersList[0].AddDiscipline("Computer sciense", 4, 5);
teachersList[0].AddDiscipline("Hardware basics", 3, 2);
teachersList[1].AddDiscipline("C# Basics", 4, 4);
teachersList[1].AddDiscipline("C# OOP", 5, 5);
teachersList[2].AddDiscipline("Operating Systems", 3, 2);
//Console.WriteLine(teachersList.Print());
//Class test
//Console.WriteLine("Class test");
Class classA = new Class('A', teachersList, studentsList);
//Console.WriteLine(classA.ToString());
Class classB = new Class('B', teachersList, studentsList);
classB.Comments = "This is class B";
//School test
Console.WriteLine("School test:");
School TUES = new School();
TUES.AddClass(classA);
TUES.AddClass(classB);
Console.WriteLine(TUES.ToString());
}
示例2: Main
public static void Main()
{
Student student1 = new Student("Aaaa Bbb", 1);
Student student2 = new Student("Cccc Ddd", 2);
Student student3 = new Student("Eeee Fff", 3, "ZZZZZZZZZZZZZ");
Teacher teacher1 = new Teacher("Zzzz yyyy");
Teacher teacher2 = new Teacher("Xxxx wwww");
Discipline oop = new Discipline("oop", 12, 10, "AAAAAAAA");
Discipline csharp = new Discipline("Csharp", 20, 14);
Discipline java = new Discipline("Java", 15, 16);
teacher1.AddDisicipline(oop);
teacher1.AddDisicipline(csharp);
teacher2.AddDisicipline(oop);
teacher1.ListOfDisciplines.Add(java);
School mySchool = new School();
ClassInSchool myClass = new ClassInSchool("MyClassName");
myClass.AddStudent(student1);
myClass.AddStudent(student2);
myClass.AddStudent(student3);
myClass.RemoveStudent(student1);
myClass.AddTeacher(teacher1);
myClass.AddTeacher(teacher2);
mySchool.AddClass(myClass);
System.Console.WriteLine(myClass);
}
示例3: 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);
}
}
}
}
示例4: 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);
}
示例5: Main
private static void Main()
{
var mg = new School("Математическа гимназия - Атанас Радев");
var stanislav = new Student("Станислав Славов", 124225);
var gosho = new Student("Георги Ганков", 124233);
var biology = new Discipline("Биология", 10, 8);
var physics = new Discipline("Физика", 8, 4);
var math = new Discipline("Математика", 20, 20);
var english = new Discipline("Английски език", 18, 10);
var literature = new Discipline("Литература", 10, 0);
var minka = new Teacher("Минка Георгиева");
var pencho = new Teacher("Пенчо Минчев");
minka.AddToughtDisciplines(biology, literature, english);
pencho.AddToughtDisciplines(math, physics);
var b12 = new Class("12-ти Б");
mg.AddClass(b12);
b12.AddStudents(stanislav, gosho);
}
示例6: Main
static void Main()
{
var school = new School("St. Kliment Ohridski");
var _class = new Class("IT 3rd Semester");
var teachers = new Teacher[]
{
new Teacher("Peter", "Ivanov", "Georgiev").AddDiscipline(new Discipline("Math", 20, 30), new Discipline("IT", 100, 150)),
new Teacher("Georgi", "Ivanov", "Ivanov").AddDiscipline(new Discipline("English")),
new Teacher("Filip", "Borisov", "Hristov").AddDiscipline(new Discipline("Physics", 2, 3), new Discipline("Analisys", 5, 10))
};
var students = new Student[]
{
new Student("Georgi", "Ivanov", "Petrov", 1),
new Student("Ivan", "Ivanov", "Georgiev", 2),
new Student("Hristo", "Borisov", "Filipov", 3),
new Student("Filip", "Ivanov", "Georgiev", 4),
new Student("Georgi", "Ivanov", "Petrov", 5),
new Student("Hristo", "Borisov", "Filipov", 6)
};
school.AddClass(_class);
// Add teachers and students to the class
_class.AddTeacher(teachers);
_class.AddStudent(students);
// Remove / Add new student
_class.RemoveStudent(new Student("Ivan", "Ivanov", "Georgiev", 2));
_class.AddStudent(new Student("Added", "New", "Student", 2));
// Remove / Add new teacher
_class.RemoveTeacher(new Teacher("Peter", "Ivanov", "Georgiev"));
_class.AddTeacher(new Teacher("Added", "New", "Teacher").AddDiscipline(new Discipline("IT", 5, 10)));
Console.WriteLine(school);
// Remove class
school.RemoveClass(new Class("IT 3rd Semester"));
Console.WriteLine(school);
}