static void Main(string[] args) { var reptile = new Reptile("Crocodile"); var mammal = new Mammal("Koala"); var bird = new Birds("Parrot"); Console.WriteLine("Who want a baby?"); Console.WriteLine(reptile.GetName() + ", " + reptile.WantChild()); Console.WriteLine(mammal.GetName() + ", " + mammal.WantChild()); Console.WriteLine(bird.GetName() + ", " + bird.WantChild()); }
static void Main(string[] args) { var crocodile = new Reptile(Animal.AnimalType.Crocodile, Animal.GenderType.Female); var frog = new Reptile(Animal.AnimalType.Frog, Animal.GenderType.Female); var mammal = new Mammal(Animal.AnimalType.Koala, Animal.GenderType.Female); var bird = new Bird(Animal.AnimalType.Bird, Animal.GenderType.Male); crocodile.Greet(); frog.Greet(); mammal.Greet(); bird.Greet(); Console.WriteLine(); Console.WriteLine("Who want a baby?"); Console.WriteLine(crocodile.Name + ", " + crocodile.WantChild()); Console.WriteLine(frog.Name + ", " + frog.WantChild()); Console.WriteLine(mammal.Name + ", " + mammal.WantChild()); Console.WriteLine(bird.Name + ", " + bird.WantChild()); Console.ReadLine(); }