Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- эта.. я не крестовик, но виртуальные функции уже отменили чтоль? в задании же про общий интерфейс, а не реализацию говорится
- [code]
- class Shape
- {
- public:
- float perimeter() = 0;
- float area() = 0;
- }
- class Triangle : Shape
- {
- public:
- float perimeter(); //triangle-specific perimeter
- float area(); //triangle-specific area
- }
- class Rectangle : Shape
- {
- public:
- float perimeter(); //rectangle-specific perimeter
- float area(); //rectangle-specific area
- }
- [/code]
Advertisement
Add Comment
Please, Sign In to add comment