Question: In this lab you are required to create a class called Animal with the private fields called name and sound The Animal class should have
In this lab you are required to create a class called Animal with the private fields called name and sound The Animal class should have the following definition clast Anina1{ private: string name: string sound: public: Animal(const string& n = const string& s = "") string gat Name() coast: string make Sound() const: The public methods of the class Animal are the constructor, which initialises and sound get Name() which returns the name of the animal and make Sound(). which returns the sound an animal makes. You must overload the operator " says ' Input Main: int main() (Animal* monkey = new Animal("Frank" "Squeak") Animal* tiger = new Animal("Simba" "woof") Animal" Dog = new Animal ("Petals" "woof") cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
