Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 Define and implement a class named hunter

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

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); // create a hunter of the given species void record_kill(string kill); // add a new kill to the end of the hunter's list of kills int numberOfKills(); // how many kills have been recorded // implement ONE of the following string * get_kills(); // return an array of all kills by this hunter
vector get_kills(); // 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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago