#include #include using namespace std; class Tier { protected: float anzahl; public: Tier(){};//Defaultkonstruktor Tier (int anz):anzahl(anz){}; //Konstruktor mit Elementinitialisierungsliste }; class Schlachtvieh: public Tier { private: float gewicht; public: Schlachtvieh(int anz, float gew):Tier(anz),gewicht(gew){}; void datenausgeben() { cout << "Es sind " << anzahl << " Tiere mit je " << gewicht << " kg vorhanden" << endl; } }; class Milchvieh: public Tier { private: float milchleistung; public: Milchvieh(int anz, float m_l):Tier(anz), milchleistung(m_l){}; void datenausgeben() { cout << "Es sind " << anzahl << " Tiere mit durchschnittlicher Milchleistung von " << milchleistung << " l vorhanden"<