using System.Collections.Generic;
public abstract class Animal : Pet
public override string ToString()
return "Animal: this is the default";
public class Cat : Animal, Pet
public override string ToString()
return "Cat: a kitty is here";
public class Fish : Animal, Pet
public override string ToString()
return "Fish: Smells fishy";
public List<Animal> Animals = new List<Animal>();
public Zoo(string nm, string cit, int cap)
Animals.Add(new Animal.Fish());
public void removeAnimal()
public void printMethod(string ToString)
foreach (Animal a in Animals)
public static void Main()
string nm = "National Zoo";
string cit = "Washington, D.C.";
Zoo myFavoriteZoo = new Zoo(nm, cit, cap);
Console.WriteLine("my Favorite Zoo's name is: " + myFavoriteZoo.Name);
Console.WriteLine("My Favorite Zoo's location is: " + myFavoriteZoo.City);
Console.WriteLine("My Favorite Zoo's capacity is: " + myFavoriteZoo.Capacity);
Animal a1 = new Animal.Cat();
Animal a2 = new Animal.Fish();
Console.WriteLine("Tiger and Angelfish have been added to the Zoo");
Console.WriteLine("These are the animals in the Zoo: ");
foreach (string j in Animals)
Console.WriteLine("The first animal from the Zoo has been removed. The current animals are: ");
foreach (string m in Animals)