Question: C++ program Convex Polygons Your objective in this assignment is to write a program to compute the circumference and area of an arbitrary convex polygon

C++ program
 C++ program Convex Polygons Your objective in this assignment is to

Convex Polygons Your objective in this assignment is to write a program to compute the circumference and area of an arbitrary convex polygon with three or more sides. Specifically, your program should do the following 1. Accept from the keyboard the definition of a polygon. The polygon is entered, one vertex at a time with each vertex defined as a point in Cartesian coordinates (x, y). See the sample run below. 2. Display the polygon definition as a table of (x, y) points. 3. Display the circumference of the polygon. 4. Display the area of the entire polygon, as well as the area of each of the polygon's component triangles. Note that for a polygon having "n sides, the area is the sum of the areas of "n-2" triangles as shown in the figure below The area of each triangle may be computed from the formula: adh d c re the sides of the triangle. a+b+ c AS-(-s -b-(s-o where sbt of the 3 (xi, yi) Ai (o yo)s Az Aj As (xs, ys) ENTER A POLYGON DEFINITION: Enter next point: 0 70 Enter next point: 50 90 Enter next point: 80 80 Enter next point: 90 40 Enter next point: 60 10 S Enter next point: 10 20 A Enter next point: -1 A negative x coordinate terminates Here is the polygon definition: P (o, 70) L (50, 90) (80, 80) (90, 40) (60, 10) R (10, 20) circumference 271.112 NI Polygon Area 5200 Triangle 1: Area 550 Triangle 2: Area 1650 Triangle 3: Area 1800 Triangle 4: Area 1200 8/22/2018-gpe Page 1/4

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!