All pastes #808912 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-12-08 00:33 UTC
rendered paste body
class circle
{
   private:  
     int radius;
     int x;
     int y;
   public:
     circle(int r,int xcoordinate,int ycoordinate)//This is a constructor
     {
         radius=r;
         x=xcoordinate;
         y=ycoordinate;
     }
     int area()
     {
          return 3.14*radius*radius;
     }
} 

int main()
{
     circle ThisIsACircleClass(3,0,0);//This is Me constructing a circle of radius 3, at (0,0)
     int area= ThisIsACircleClass.area();
     return 0;
}








This is the function we need to call in our pics.cpp (our main function)

void ShapeDrawer::drawLine(Line l) {
	int xa = l.getStart().getX();
	int ya = l.getStart().getY();
	int xb = l.getEnd().getX();
	int yb = l.getEnd().getY();
	int red = l.getColor().getRed() ....it keeps going etc....

Line is a class.

So how do we implement this? am I making sense?