Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. class Figure {
  2. protected:
  3. std::string fill;
  4. std::string stroke;
  5. int strokeWidth;
  6. virtual void setInfo(std::string line);
  7. public:
  8. void print() const;
  9. };
  10. void Figure::print() const {
  11. std::cout << fill << ' ' << stroke << ' ' << strokeWidth << std::endl;
  12. }
  13.  
  14. class Rectangle : public Figure {
  15. double x,y,width,height;
  16. public:
  17. void setInfo(std::string line);
  18. void print() const;
  19. };
  20. void Rectangle::print() const {
  21. std::cout << ". rectangle " << x << ' ' << y << ' ' << width << ' ' << height << ' ';
  22. Figure::print();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement