Create a fucntin defintion for the line class constructor


Discuss the below:

Q: The following class uses composition to define a line object in terms of two point objects.

class line
{
public:
Point startingpoint();
point endingpoint();
float length();
line (int startX, int startY, int endX, int endY);

private:
point startPoint;
point endPoint:

};

1) Create a fucntin defintion for the Line class constructor
2) for the line class implement the StartingPoint() and EndingPoint() member functions
3) for the line class implement the lenght() member function. the distance between two points (x1,y1) and (x2,y2) is sqrt ((x1,x2)2 + (x2,y2)2)

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create a fucntin defintion for the line class constructor
Reference No:- TGS01937529

Now Priced at $20 (50% Discount)

Recommended (97%)

Rated (4.9/5)