static void Main(string[] args) { Dog dog = new Dog("Kabosu", new DateTime(2010, 10, 11)); Console.WriteLine($"Возраст Кабосу : {dog.Age} лет "); //((IWalking)dog).Walk(); Butterfly but = new Butterfly("Machaon", new DateTime(2019, 10, 10)); Console.WriteLine($"Возраст Махаона : { but.Age} год"); //((IFlying)but).Fly(); Bird bidy = new Bird("Tanusha", new DateTime(2007, 7, 7)); Console.WriteLine($"Возраст Танюши: {bidy.Age} лет"); //((IFlying)bidy).Fly(); Fish fsh = new Fish("Nemo", new DateTime(2007, 7, 12)); Console.WriteLine($"Возраст Немо: { fsh.Age} лет"); //((ISwimming)fsh).Swim(); Gym gym = new Gym(); gym.AddAnimal(dog); gym.AddAnimal(but); gym.AddAnimal(bidy); gym.AddAnimal(fsh); gym.LetsMove(); Console.ReadKey(); }
static void Main(string[] args) { Dog d = new Dog("Жирмэн", new DateTime(2018, 10, 10)); Console.WriteLine(d.Age); ((IWalking)d).Walk(); Butterfly but = new Butterfly("Крылатка", new DateTime(2005, 03, 08)); ((IFlying)but).Fly(); Bird bid = new Bird("Лётчик", new DateTime(2009, 12, 12)); ((IFlying)bid).Fly(); Fish fis = new Fish("Пузырик", new DateTime(2008, 11, 11)); ((ISwimming)fis).Swim(); Console.ReadLine(); }