Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Figure {
- protected:
- std::string fill;
- std::string stroke;
- int strokeWidth;
- virtual void setInfo(std::string line);
- public:
- void print() const;
- };
- void Figure::print() const {
- std::cout << fill << ' ' << stroke << ' ' << strokeWidth << std::endl;
- }
- class Rectangle : public Figure {
- double x,y,width,height;
- public:
- void setInfo(std::string line);
- void print() const;
- };
- void Rectangle::print() const {
- std::cout << ". rectangle " << x << ' ' << y << ' ' << width << ' ' << height << ' ';
- Figure::print();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement