For the code below add the following. Add a non member function that will run the show function of a Sport object. This object is the one parameter of the function. Make the necessary changes so that when an object of BallSport is the parameter of the function, it will show the correct output (using polymorphism).
#include
#include
using namespace std;
class Sport
{
public:
Sport()
{
kind = "who knows";
}
void show()
{
cout << "this is " << kind << endl;
}
private:
string kind;
};
class BallSport : public Sport
{
public:
void set(string bt)
{
balltype = bt;
}
void show()
{
cout << "this is " << balltype << "ball\n";
}
private:
string balltype;
};
int main()
{
return 0;
}