#include <iostream>
#include <string>
using namespace std;
class papa
{
public:
virtual void plus(int a, int b);
virtual void plus(string a, string b);
virtual void info(string text);
};
class sohn : public papa
{
public:
void plus(int a, int b);
void plus(string a, string b);
// void info(string text);
};
void papa::plus(int a,int b)
{
int erg;
erg = a+b;
cout << "papa::plus (mit Parameter ganze Zahl): Das Ergebnis lautet " << erg << endl;
}
void papa::plus(string a,string b)
{
string erg;
erg = a+b;
cout << "papa::plus (mit Parameter String): Das Ergebnis lautet " << erg << endl;
}
void papa::info(string text)
{
cout << "papa::info: " << text << endl;
}
void sohn::plus(int a,int b)
{
cout << "sohn::plus (mit Parameter ganze Zahl): Ich mag nichts rechnen !" << endl;
}
void sohn::plus(string a,string b)
{
cout << "sohn::plus (mit Parameter String): Ich mag nichts rechnen !" << endl;
}
/*
void sohn::info(string text)
{
cout << "sohn::info: " << "Ich mag nichts sprechen !" << endl;
}
*/
int main()
{
papa Arbeiter;
sohn Spieler;
Arbeiter.plus(111,222);
Arbeiter.plus("111","222");
Arbeiter.info("Ich bin so muede.");
Spieler.plus(111,222);
Spieler.plus("111","222");
Spieler.info("Mir ist so fad.");
}