You are given the code for the Animal class. Declare a class Dog that is a subclass of Animal. The Doc class should override the getTypeString function so that it returns "Canine" instead of "Animal".
You are given the code for the Animal class. Declare a class Dog that is a subclass of Animal. It does not need any new member variables. Make a constructor for Dog that takes no parameters, but sets numLegs to 4 by calling the Animal constructor in its initialization list.
Write a class ThreeDPoint that inherits from TwoDPoint and adds a z coordinate. You should not use composition or create your own x and y variables. ThreeDPoint should only need to store a z value.
Make an abstract class Number that declares an abstract function getValue() that allows the rest of the code to work correctly. (You wonβt need to implement any variables or functions in Number, so technically it will be an interface.)
Then add a global function (not a member function of your class) double getDoubled that accepts a Number reference and returns double the value of the Number. The function should work for any class that extends Number, such as Integer or Double.