Review the Animal UML diagram and answer the following quest

Review the Animal UML diagram and answer the following questions:

If you needed to add a new class called Crow, what would be the best parent class for it? Explain.

Is Reptile a good place to put the bodyTemperature variable? Explain.

Assume that the fly() method in Bird is a full implementation (not abstract). If you needed to add a child class to Bird called Ostrich, what could you do in Ostrich to disable flight? Explain.

Solution

Bird is a parent of crow.

Common feature like a bird can fly method is applicable to crow.

Reptile class is suitable to include body temperate.

Example:reptiles like lizard control their body temperature by adjusting its position.

If fly() method is implemented in bird class and its subclass like Ostrich we can override it.

By overriding fly() method in ostrich class we can disable this feature.

Review the Animal UML diagram and answer the following questions: If you needed to add a new class called Crow, what would be the best parent class for it? Expl

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site