Sie sind auf Seite 1von 1

#pragma once #include <iostream> using namespace std; class Figure { protected: void virtual draw(); void virtual

erase(); public: void centering() { cout << "Calling centering()... " << endl; draw(); erase(); } }; class Rectangle : public virtual Figure { private: int height; int width; int center_X; int center_Y; public: void virtual draw() { cout << "draw() was called" << endl; } void virtual erase() { cout << "erase() was called" << endl; } void centering() { cout << "Calling centering()... " << endl; draw(); erase(); } }; class Triangle : public virtual Figure { private: int sideA; int sideB; int Hypotenuse; public: };

Das könnte Ihnen auch gefallen