{/*Створити суперклас Птах і підкласи Орел, Папуга, Нелітаючий птах, Страус, Пінгвін. * За допомогою конструктора задати вік кожного птаха. * Визначити максимальну висоту польоту літаючих птахів та швидкість бігу нелітаючих.*/ static void Main(string[] args) { Eagle eagle = new Eagle(100, 10, true); Parrot parrot = new Parrot(40, 4, true); Pinguin pinguin = new Pinguin(60, 30, false); Straus straus = new Straus(120, 42, false); eagle.Born(); eagle.Move(); eagle.StopMoving(); eagle.Die(); Console.WriteLine(eagle.GetInfo()); Console.WriteLine(new string('-', 30)); parrot.Born(); parrot.Move(); parrot.StopMoving(); parrot.Die(); Console.WriteLine(parrot.GetInfo()); Console.WriteLine(new string('-', 30)); pinguin.Born(); pinguin.Move(); pinguin.StopMoving(); pinguin.Die(); Console.WriteLine(pinguin.GetInfo()); Console.WriteLine(new string('-', 30)); straus.Born(); straus.Move(); straus.StopMoving(); straus.Die(); Console.WriteLine(straus.GetInfo()); Console.WriteLine(new string('-', 30)); }
static void Main(string[] args) { Parrot p1 = new Parrot(); p1.FlyAway(); Horse h1 = new Horse(); h1.BiteParrot(); Animal an2 = new Parrot(); an2.Move(1); Cat c = new Cat(); //c.AnimalType = AnimalType.Cat; c.Sit(); c.Jump(); Dog d = new Dog(); d.Move(7); d.Jump(); Animal[] type = new Animal[2]; type[0] = c; type[1] = d; for (int i = 0; i < type.Length; i++) { // if(type[i].AnimalType==AnimalType.Dog) Console.WriteLine(AnimalType.Cat); Console.WriteLine(AnimalType.Dog); } Console.ReadLine(); Audi a1 = new Audi(); a1.Engine = "v8"; a1.Body = "red"; a1.Wheels = 4; a1.Name = "nazwa"; a1.Start(5); Console.ReadLine(); Book test = new ProfessionalBook(); test.Cover = true; test.Page = 657; test.Title = "Selenium"; test.Buy(); test.Read(); Console.ReadLine(); }