10-152-311 - Object-Oriented Programming 1

6.2 Zoo Lab Class Diagram: Overview

  1. Modify the Violet UML class diagram contained withing this 6.2 Zoo Class Diagram starting zip file, following these specifications:
    1. Remove the following classes from the diagram, by "folding them in" to the classes which reference them, as appropriate:
      1. Vending Machine
    2. Change Animal class:
      1. Make the class abstract.
      2. Remove babyDingoWeight and babyPlatypusWeight fields.
      3. Add private preferredFootType (string) field.
      4. Add public PreferredFootType read/write property (with protected setter).
      5. Add protected abstract BabyWeightPercentage (double) read-only property.
      6. Create a public abstract Move method.
      7. Make the Reproduce method to be virtual.
      8. Add an overridden ToString method.
    3. Change the Mammal class:
      1. Make the class abstract.
      2. Add overridden Move method.
      3. Add overridden Reproduce method.
    4. Move animal-specific methods down from the Animal class to the appropriate descendant:
      1. Mammal: FeedNewborn.
    5. Make the Platypus class sealed.
    6. Create a Bird class:
      1. Make the class abstract.
      2. Descend from the Animal class.
      3. Add a constructor with three parameters: age (int), name (string), and weight (double).
      4. Add overridden Move method.
    7. Create a Hummingbird class:
      1. Descend from the Bird class.
      2. Add a constructor with three parameters: age (int), name (string), and weight (double).
      3. Add overridden BabyWeightPercentage.
      4. Add overridden Eat method.
    8. Add overridden BabyWeightPercentage property to Dingo, Platypus, and Hummingbird classes.
  2. Using Violet, export the diagram to a .png file (File, Export to | Image file).
  3. Submit the file via Blackboard.