Question: C programming Description Write a program called perimeterc that find the perimeter of an arbitrary shape. Your program will be provided a binary file that

C programming

C programming Description Write a program called perimeterc that find the perimeter

Description Write a program called perimeterc that find the perimeter of an arbitrary shape. Your program will be provided a binary file that contains the vertices of the shape and your program should print out the premiter of the given shape. Additional Details You MUST use a struct in your solution o I recommend have a Point struct The name of the binary file will passed as a command line parameter The binary file contains only integers . The first integer is the number of points in the file The remaining integers are points representing the vertices of the shape There is an edge between each adjacent point and between the last point and the first point There are at least 3 points in each file o The perimeter of a polygon is the sum of the lengths of all of its edges . If you really look at the the pcints in the file you will see that they don't actually represent convex polygons but treat them like the files like they do Examples User input has been underlinedi to help you differentiate what is user input and what is program output Hints If you are curious about what is in the file you can use the binarinteger printing program we wrote in class. * Examples In this example assume that the file example.xt contained the following values in binary. I'm displaying the file as text below to help you get an understanding of what the file looks like but remember the file is in binary with no spaces between any of the values. Example 1 287 022 83-981 81 607 perimeter out example.txt The perimeter i 3648.30

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!