Guest User

Untitled

a guest
Jul 18th, 2012
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. эта.. я не крестовик, но виртуальные функции уже отменили чтоль? в задании же про общий интерфейс, а не реализацию говорится
  2. [code]
  3. class Shape
  4. {
  5. public:
  6. float perimeter() = 0;
  7. float area() = 0;
  8. }
  9.  
  10. class Triangle : Shape
  11. {
  12. public:
  13. float perimeter(); //triangle-specific perimeter
  14. float area(); //triangle-specific area
  15. }
  16.  
  17. class Rectangle : Shape
  18. {
  19. public:
  20. float perimeter(); //rectangle-specific perimeter
  21. float area(); //rectangle-specific area
  22. }
  23. [/code]
Advertisement
Add Comment
Please, Sign In to add comment