I saw this question online, and i would like to know if i am doing this correctly or not. The site does not list the answer or guides.
The question
Write the declaration only for the abstract class Animal. Animal should contain attributes for name and age, and functions display, setFields and concrete. Write the declaration and implementation, of a class Tiger derived from Animal, with the Tiger having overridden functions which were appropriate, use the base class one. The Tiger has additional data fields associated with strips(an integer) and tailLength.
I would appericate, if you can tell if i am doing it correctly.
Animal class
class Animal{
private:
string name;
int age;
public:
void display();
void setFields(string, int);
void concrete();
};
Tiger class
class Tiger:public Animal{
private:
int strips;
int tailLength;
public:
void display();
void setFields(string, int, int, int);
};