Class Diagram: see image.

This assignment aims to practice concepts from object-oriented programming and integrate our new skills with UML diagrams. Accordingly, you will need to do the following:

1. Create a class Zoo with the fields or properties, constructor, and methods seen in the figure. Most importantly:

  • There should be a non-default constructor that accepts a name, city, and capacity to instantiate the Zoo class.
  • One of the fields in Zoo is Animals, which is a List object made of objects from the Animal class.
  • The addAnimal method adds an Animal to the Animals List.
  • The removeAnimal method removes an Animal from the Animals List. You can remove the last or the first Animal to make it easier.
  • The printMember method calls the ToString() method of each of the Animals in the Animals List.

2. Create an Abstract Class, Animal, with the fields or properties seen in the figure.

3. Create an interface, Pet, with the field or properties(s) seen in the figure.

4. Create two classes, Cat and Fish that are children's classes from Animal. These classes have their own fields or properties, as seen in the figure, and each of them overrides the ToString() method from Object.

The Cat ToString() method should print to the Console "Cat: a kitty is here."
The Fish ToString() method should print to the console: "Fish: Smells fishy."

5. Create a Program class (not shown in the figure) with a Main() method to test your work with an instance of your favorite Zoo. If you do not have a favorite, may I suggest the Smithsonian's National Zoo in Washington, D.C. or Munich's Tierpark Hellabrunn? Your test should test all of the classes and members in the assignment and clearly show your work on the console.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.