Question: using c++ language divide program to main.cpp,hunter.h,hunter.cpp need use g++ -o count hunter.cpp main.cpp in terminal to compile The code for the animal is given

 using c++ language divide program to main.cpp,hunter.h,hunter.cpp need use "g++ -o

using c++ language

divide program to main.cpp,hunter.h,hunter.cpp

need use "g++ -o count hunter.cpp main.cpp "in terminal to compile

The code for the animal is given below:

count hunter.cpp main.cpp "in terminal to compile The code for the animalis given below: Part 2 - Inheritance 2-1 Define and implement aclass named hunter. A hunter object represents an animal that hunts for

Part 2 - Inheritance 2-1 Define and implement a class named hunter. A hunter object represents an animal that hunts for its food in the wild The hunter class must be defined by inheriting from the animal class. The hunter class has the following public constructors and behaviours: hunter(string aSpecies); void record_kill(string kill); // add a new kill to the end of the hunter's list of kills int numberOfKills // create a hunter of the given species // how many kills have been recorded // implement ONE of the following string get killsO; // return an array of all kills by this hunter vector get_killsO; // return a vector of all kills by this hunter Your main program should create a hunter object to represent a "Cheetah" and record kills of 1 "Mouse", 2 "Gazelle", 1 "Hyena" and 2 "Rabbit". The hunter object initially has no kills. Your main program must print all the kills recorded by the hunter object. 2-2 Define and implement a class named vegie. A vegie object represents an animal that only eats vegetables The vegie class must be defined by inheriting from the animal class. The vegie class has the following public constructors and behaviours: vegie(string aSpecies); // create a vegie of the given species, its favourite food is "Grass" void set favourite_food(string aVegie); // change the vegie's favourite food string getFavouriteFoodO; Your main program should create a vegie object to represent a "Goat" and record its favourite food as being "Hats". The vegie object initially has "Grass" recorded as its favourite food. Your main program must demonstrate that the favourite food can be changed

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!