Just add the following table and change it to your values
class Shape {
public:// interface to users of Shapes
virtual void draw() const;
virtual void rotate(int degrees);
// …
protected:// common data (for implementers of Shapes)
Point center;
Color col;
// …
};
class Circle : public Shape {
public:
void draw() const;
void rotate(int) { }
// …
protected:
int radius;
// …
};
class Triangle : public Shape {
public:
void draw() const;
void rotate(int);
// …
protected:
Point a, b, c;
// …
};
September 22nd, 2009 at 3:29 pm
Just add the following table and change it to your values
class Shape {
public:// interface to users of Shapes
virtual void draw() const;
virtual void rotate(int degrees);
// …
protected:// common data (for implementers of Shapes)
Point center;
Color col;
// …
};
class Circle : public Shape {
public:
void draw() const;
void rotate(int) { }
// …
protected:
int radius;
// …
};
class Triangle : public Shape {
public:
void draw() const;
void rotate(int);
// …
protected:
Point a, b, c;
// …
};
References :