Define classes that satisfy the following conditions and the hierarchy in the diagram given in the class.

A definition of an object, for a class in the bottom of the hierarchy, should produce a message consisting of the names of all the classes that directly or indirectly are related to the object.
A definition of an object for a class not in the bottom of the hierarchy should prompt the compiler to issue an error message.
Each defined object should be able to respond to the following functions.
talk-- A parameter-free function that produces a message from the object.
xivore-- A parameter-free function that produces one of "carnivore" or "herbivore" that reflects the kind of object in discourse.
Each of the classes is allowed to explicitly declare at most two member functions, with at most one of the two not being a constructor.
The body of each member function should be a single command of the form cout<<" ....";
A string containing the name of a class may appear only within members of the class. (That is, if A is a name of a class and x is a string "...A..." referring to A, then x may only be included within members of A)


Example: The program

#include ...

//missing definitions

int main( )

{

leopard a;

a.talk( );

a.xivore( );

return 0;

}

should produce an output of the following form.

animals carnivore cats leopard

leooo

carnivore