Question: Part 1 - OOP with Animals This first part is a quick problem to get comfortable with OOP structuring. It is autograded, only worth 10%

Part 1 - OOP with Animals This first part is a quick problem to get comfortable with OOP structuring. It is autograded, only worth 10% of the assignment, and should take you 20 minutes to complete. Create classes to represent the following hierarchy using inheritance in a module called Animals.py. Figure 1: Taxonomy to implement Implement the following functionality: a) Every class should be initialized with a name - call this instance variable name. Because all objects share this behavior, you can put it in the Animal constructor _.init... b) Every class except ComputerScientist should define its own speak() method, which returns a string giving the name and an appropriate sound for that class. We only test the actual return string for Cat.speak, but we do test that the other objects all implement thier own speak method. c) Do not implement speak in the ComputerScientist subclass - it should default to whatever method you define for Primate. d) The Animal superclass should define a method called reply(), which just calls the relevant speak: >c1=Cat( Babs ) > c1.speak() \# should call Cat.speak() 'Babs says Meow!' 'Babs says Meow
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
