Question: A polygon is convex if it contains any line segments that connects two points of the polygon. Write a program that prompts the user to
A polygon is convex if it contains any line segments that connects two points of the polygon. Write a program that prompts the user to enter the number of points in a convex polygon, then enter the points clockwise, and display the area of the polygon. Here is a sample run of the program:
Enter the number of the points: 7 Enter the coordinates of the points: -12 0 -8.5 10 0 11.4 5.5 7.8 6 -5.5 0 -7 -3.5 -3.5 The total area is 250.075
Step by Step Solution
3.43 Rating (156 Votes )
There are 3 Steps involved in it
Program Plan First define a Package polygon Define a Point class within the package This class store... View full answer
Get step-by-step solutions from verified subject matter experts
