static void Main(string[] args) { Humans zhorik = new Humans("Жорик", "Мужчина", 04, 01, 2002); Student Zhorik = new Student(zhorik, "ИПЗ-19-3", "ФИКТ", 1); Bibluser Maks = new Bibluser("Макс", "Мужчина", new DateTime(2000, 08, 06), 8, new DateTime(2020, 11, 22)); Teacher Oksana = new Teacher("Оксана", "Женщина", new DateTime(1987, 04, 05), "Математика", "ФИКТ"); Abit zhorik2 = new Abit(zhorik, 194, 189, 188, 10); Humans[] humans = { zhorik, Zhorik, Maks, Oksana, zhorik2 }; for (int i = 0; i < humans.Length; i++) { Console.WriteLine(humans[i].GetName()); Console.WriteLine(humans[i].GetGender()); Console.WriteLine(humans[i].GetBirthday()); } Console.WriteLine("--------"); Console.WriteLine("Читацкий билет"); Console.WriteLine("Имя: " + Maks.GetName()); Console.WriteLine("Пол: " + Maks.GetGender()); Console.WriteLine("Дата рождения: " + Maks.GetBirthday()); Console.WriteLine("Кол-во книг на руках:" + Maks.GetBookAmt()); Console.WriteLine("Билет действителен до:" + Maks.GetTicketDate()); }
public Humans(Humans human) { Name = human.Name; Gender = human.Gender; Birthday = human.Birthday; }
public Bibluser(Humans human, byte bookamt, DateTime ticketdate) : base(human) { SetBookAmt(bookamt); SetTicketDate(ticketdate); }
public Student(Humans human, string group, string faculte, byte course) : base(human) { SetGroup(group); SetFaculte(faculte); SetCourse(course); }
public Teacher(Humans human, string subject, string faculte) : base(human) { SetSubject(subject); SetFaculte(faculte); }