Question: animals.cpp: #include #include Dog.h using namespace std; int main(int argc, const char * argv[]) { Dog myDog = Dog(Bruno, 4); cout Animal.h: #pragma once

\ animals.cpp: #include #include "Dog.h" using namespace std; int main(int argc, const\

char * argv[]) { Dog myDog = Dog("Bruno", 4); cout Animal.h: #pragma

animals.cpp:

#include  #include "Dog.h" using namespace std; int main(int argc, const char * argv[]) { Dog myDog = Dog("Bruno", 4); cout  

Animal.h:

#pragma once #include #include #include

using namespace std;

class Animal { string name; int age;

public:

Animal() { cout

void display(const vector & list) {

}

string getName() { return name; }

void setName(string name) { this->name = name; }

int getAge() { return age; }

void setAge(int age) { this->age = age; }

~Animal() { cout

void feed() { cout

};

Get the file Animal.h. It contains an Animal class that stores the name and age of an animal. Besides the appropriate constructors, getters, and setters it has a function called feed() which prints out the message "Some meal, please!!". Dogs are animals too, so we can extend the Animal class to produce a Dog class. We only need to change the constructors and destructors of the Dog class to print the appropriate messages and we need to change the feed() function to print a message saying "A small bone, please!" Your class should be stored in a file called Dog.h. Your solution will be tested with the file animals.cpp. Sample output from animals.cpp Creating Generic Animal Creating Dog Bruno is 4 years old. A small bone, please!! Deleting Dog Deleting Generic Animal

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!