Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago