using System.Collections.Generic;
public string Name { get; set; }
public string City { get; set; }
public int Capacity { get; set; }
public List<Animal> Animals { get; set; }
public Zoo(string name, string city, int capacity)
Animals = new List<Animal>();
public void AddAnimal(Animal animal)
if (Animals.Count < Capacity)
Console.WriteLine($"Added {animal.Name} to the zoo!");
Console.WriteLine($"The zoo is at full capacity and cannot add {animal.Name}.");
public void RemoveAnimal(Animal animal)
Animal removedAnimal = Animals[Animals.Count - 1];
Animals.RemoveAt(Animals.Count - 1);
Console.WriteLine($"Removed {removedAnimal.Name} from the zoo.");
Console.WriteLine("There are no animals in the zoo to remove.");
public void PrintMembers()
Console.WriteLine($"{Name} in {City} has the following animals:"); foreach (Animal animal in Animals)
Console.WriteLine(animal.Name);
public string Name { get; set; }
public int Age { get; set; }
public bool Female { get; set; }
public Animal(string name, int age, bool female)
string Playful { get; set; }
public string Breed { get; set; }
public string Playful { get; set; }
public Cat(string name, int age, bool female, string breed, string playful) : base(name, age, female)
public override string ToString()
return $"{Name} the {Breed} cat is {Age} years old and is known for being {Playful}.";
public int SwimSpeed { get; set; }
public string Playful { get; set; }
public Fish(string name, int age, bool female, int swimspeed, string playful) : base(name, age, female)
public override string ToString()
return $"{Name} the fish is {Age} years old, and swim at speeds of {SwimSpeed} miles per hour, and is known for being {Playful}";
public static void Main (string[] args)
Zoo z1 = new Zoo("Fun Zoo", "Indianapolis", 3);
Cat c1 = new Cat("Tom", 3, false, "Calico", "playful");
Cat c2 = new Cat("Ms. Whiskers", 7, true, "Birman", "not playful");
Fish f1 = new Fish("Goldie", 3, true, 15, "not playful");
Fish f2 = new Fish("Nemo", 1, false, 12, "playful");
Console.WriteLine("----------------");
Console.WriteLine("----------------");
Console.WriteLine("----------------");