-
-
Save rkhozinov/feee2025de58238baa37ae5c13c4aaba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Linq; | |
using student; | |
namespace program | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var ocoll = new Students | |
{ | |
new Student("ivan", "petrov", "a", 1), | |
new Student("nikolay", "ivanov", "b", 2), | |
new Student("kira", "selezneva", "c", 3), | |
new Student("mary", "suzukova", "a", 1), | |
new Student("ann", "dubova", "a", 1) | |
}; | |
var coll_year = ocoll.GetByYear(1); | |
foreach (Student student in coll_year) | |
{ | |
Console.WriteLine($"coll:{student.Name} {student.Lastname} {student.Year} {student.Letter}"); | |
} | |
foreach (Student student in ocoll.SortByYear()) | |
{ | |
Console.WriteLine($"coll:{student.Name} {student.Lastname} {student.Year} {student.Letter}"); | |
} | |
Students.Display(ocoll.GetByYear(1)); | |
Students.Display(ocoll.GetByLetter("a")); | |
Students.Display(ocoll.SortByYear()); | |
Students.Display(ocoll.SortByLetter()); | |
ocoll.Promote(); | |
Students.Display(ocoll); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment