Question: Define a struct Point that has two components x and y of type float. Define a class Polygon that has private data members numberOfPoints, length

Define a struct Point that has two components x and y of type float. Define a class Polygon that has
private data members numberOfPoints, length of type float, ?**p a pointer of type Point, and
findLength(). The class has the public member functions set(int), get(), print(), a parameterized
constructor with a default value, and a copy constructor.
Implement the member functions of the class, including all #include, etc.
Sample input/output:
Enter the x and y coordinates of the 2 points:
58
126
The polygon has 2 points and length 7.28011
Hints
D=(x2-x1)2+(y2-y1)22
Length=sqrt(D). should be in c++
 Define a struct Point that has two components x and y

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!