Question: countingAnimals.cpp #include #include Animal.h using namespace std; int Animal::count = 0; int main(int argc, const char * argv[]) { Animal myAnimal; Animal anotherAnimal; cout Animal.h

 countingAnimals.cpp #include #include "Animal.h" using namespace std; int Animal::count = 0;

countingAnimals.cpp

#include  #include "Animal.h" using namespace std; int Animal::count = 0; int main(int argc, const char * argv[]) { Animal myAnimal; Animal anotherAnimal; 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

};

Modify the Animal class used in previous exercises by adding a variable named count. This variable should store the number of instances of the Animal object that have been created in the program counting Animals.cpp. Sample output from counting Animals.cpp Creating Generic Animal Creating Generic Animal 2 Deleting Generic Animal 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!