Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// http://www.cplusplus.com/forum/beginner/75558/
- #ifndef POINTTYPE_H
- #define POINTTYPE_H
- #include <iostream>
- class PointType
- {
- private:
- int x;
- int y;
- public:
- PointType(int xc, int yc):x(xc), y(yc) {}
- virtual ~PointType(){}
- void setx(int cord){x = cord;}
- void sety(int cord){y = cord;}
- int getx(){return x;}
- int gety(){return y;}
- friend std::ostream & operator<<(std::ostream & os, PointType & cords);
- };
- class Circle: public PointType
- {
- private:
- double r;
- public:
- Circle(int x, int y, double rr): PointType(x,y), r(rr) {}
- void setr(double valf){r = valf;}
- double Area();
- double Circumference();
- friend std::ostream & operator<<(std::ostream & os, Circle & crcl);
- };
- #endif // POINTTYPE_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement