/* Начальная инициализация * Выходные данные: массив студентов */ static Student[] Initialization() { Student[] student = new Student[4]; DataOfBirth dataOfBirth; UniversityGroup universityGroup; Marks marks; /* 1-ый студент */ dataOfBirth = new DataOfBirth { Year = 1995, Month = 3, Day = 28, Town = "Запорожье" }; universityGroup = new UniversityGroup { Name = "PZ10" }; marks = new Marks { Scores = new int[] { 5, 5, 5} }; student[0] = new Student("Жеваго", "Александр", dataOfBirth, universityGroup, marks); /* 2-ой студент */ dataOfBirth = new DataOfBirth { Year = 1973, Month = 2, Day = 3, Town = "Житомир" }; universityGroup = new UniversityGroup { Name = "PZ10" }; marks = new Marks { Scores = new int[] { 5, 5, 5 } }; student[1] = new Student("Жеваго", "Елена", dataOfBirth, universityGroup, marks); /* 3-ий студент */ dataOfBirth = new DataOfBirth { Year = 1995, Month = 7, Day = 20, Town = "Самара" }; universityGroup = new UniversityGroup { Name = "PZ12" }; marks = new Marks { Scores = new int[] { 5, 5, 5 } }; student[2] = new Student("Беляев", "Виталий", dataOfBirth, universityGroup, marks); /* 4-ый студент */ dataOfBirth = new DataOfBirth { Year = 1994, Month = 12, Day = 13, Town = "Днепропетровск" }; universityGroup = new UniversityGroup { Name = "PZ12" }; marks = new Marks { Scores = new int[] { 5, 5, 5 } }; student[3] = new Student("Файфер", "Сергей", dataOfBirth, universityGroup, marks); return student; }
private UniversityGroup universityGroup; // группа #endregion Fields #region Constructors /* Конструктор который инициализирует поля класса */ public Student(string firstName, string lastName, DataOfBirth dataOfBirth, UniversityGroup universityGroup, Marks marks) { this.firstName = firstName; this.lastName = lastName; this.dataOfBirth = dataOfBirth; this.universityGroup = universityGroup; this.marks = marks; }