how to display ouptut in dvc++ for this code below
#include
#include
using namespace std;
class Animal
{
protected:
//define members here
string name;
int age;
public:
//define members here
void set_data (int a, string b)
{
//define here
a= age;
b= name;
}
};
//define derived class named “Zebra” here
class Zebra:public Animal
{
public:
string message_zebra(string str)
{
//define here
str= "The zebra named "+name+" is "+ to_string(age) +"years old. The zebra comes from Africa.";
return str;
}
};
//define derived class named “Dolphin” here
class Dolphin: public Animal
{
public:
string message_dolphin(string str)
{
//define here
str= "The dolphin named "+name+" is "+ to_string(age) +"years old. The dolphin comes from New Zeland.";
return str;
}
};
Course: Learn C++ from Scratch - Free Interactive Course
Lesson: Exercise 3: Displaying Message Using Inheritance - Learn C++ from Scratch