Sport management system project inheritance in code
For example, look at the code below, and so on...
#include <iostream>
class Sport {
public:
void win()
{
std::cout << "Won!!!" << std::endl;
}
void score()
{
std::cout << "Scored!" << std::endl;
}
};
class Football : public Sport {
public:
void score()
{
std::cout << "Goooal!" << std::endl;
}
};
class Boxing : public Sport {
public:
void score()
{
std::cout << "Knockout!" << std::endl;
}
};
int main()
{
// implementation...
return 0;
}
Comments
Leave a comment