static void Main(string[] args) { Bachelor st = new Bachelor("Ivan", "Petrov", 18, "Male", "BSUIR", 4, "Informatics", "Programming Languages Types", 3200, 1); st.ShowFullInfo(); Student st2 = new Bachelor(st); st2.Info(); Master st3 = new Master(st, "Programming", Master.Degree.BussinessAdministration); st3.ShowFullInfo(); }
static void Main(string[] args) { Bachelor st = new Bachelor("Ivan", "Petrov", 18, "Male", "BSUIR", 4, "Informatics", "Programming Languages Types", 3200, 1); st.ShowFullInfo(); Console.WriteLine(); Student st2 = new Bachelor(st); st2.Info(); Aspirant st4 = new Aspirant(st, "IOT", "IITP 2020"); st4.Name = "Andrey"; st4.Surname = "Orlov"; st4.ShowFullInfo(); if (st4 is Aspirant) { Console.WriteLine($"{st4.Name} {st4.Surname} is ASPIRANT"); } if (st4 is Student) { Console.WriteLine($"{st4.Name} {st4.Surname} is STUDENT"); } Console.WriteLine(); Master st3 = new Master(st, "Programming", Master.Degree.BussinessAdministration); st3.ShowFullInfo(); Console.WriteLine(); Bachelor compSt = new Bachelor("Andrey", "Petrov", 18, 1); Bachelor compSt1 = new Bachelor("Vasiliy", "Gnomov", 19, 2); Bachelor compSt2 = new Bachelor("Kostya", "Komov", 20, 3); Bachelor[] bachelors = new Bachelor[] { compSt, compSt2, compSt1 }; Console.WriteLine("Before sorting: "); foreach (Bachelor i in bachelors) { i.ShortestInfo(); } Array.Sort(bachelors); Console.WriteLine("\nAfter sorting:"); foreach (Bachelor i in bachelors) { i.ShortestInfo(); } }
public Bachelor(Bachelor other) : base(other.Name, other.Surname, other.Age, other.Sex, other.University, other.EducationLength) { Name = other.Name; Surname = other.Surname; Age = other.Age; Sex = other.Sex; University = other.University; EducationLength = other.EducationLength; DiplomaTheme = other.DiplomaTheme; EducationCost = other.EducationCost; Course = other.Course; }