Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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++
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Describe new developments in the design of pay structures. page 475

Answered: 1 week ago