If n points are connected to form a closed polygon as snown below, tne area of thn can be computed as рolygon n-2 Area = (½)| (Xi+1 + Xi ) (yi+1 - yi ) i=0 (x1,V1) (xo,Yo)= (X6,Y6) (X2,y2) (X3,V3) (Xs,ys) (X4,Ya) n=7 Notice that although the illustrated polygon has only 6 distinct corners, n for this polygon is 7 because the algorithm expects that the last point (X6, y6) Will be repeat of the initial point, (Xo,yo). Define a structure for a point. Each point contains x coordinate and y coordinate. The representation of a Polygon must be a stack of structures in your program. Write a C program that takes the number of actual points (n-1) from the user. After that, user enters x and y coordinates of each point. (The last point will be repeat of the initial point). When you read the coordinates form the user, they are placed on your stack. In your computation, you will get the coordinates from the stack. Write a computeArea function which returns the area of the Polygon. Print the area of the Polygon in main. Display the area with two digits after the decimal point.
If n points are connected to form a closed polygon as snown below, tne area of thn can be computed as рolygon n-2 Area = (½)| (Xi+1 + Xi ) (yi+1 - yi ) i=0 (x1,V1) (xo,Yo)= (X6,Y6) (X2,y2) (X3,V3) (Xs,ys) (X4,Ya) n=7 Notice that although the illustrated polygon has only 6 distinct corners, n for this polygon is 7 because the algorithm expects that the last point (X6, y6) Will be repeat of the initial point, (Xo,yo). Define a structure for a point. Each point contains x coordinate and y coordinate. The representation of a Polygon must be a stack of structures in your program. Write a C program that takes the number of actual points (n-1) from the user. After that, user enters x and y coordinates of each point. (The last point will be repeat of the initial point). When you read the coordinates form the user, they are placed on your stack. In your computation, you will get the coordinates from the stack. Write a computeArea function which returns the area of the Polygon. Print the area of the Polygon in main. Display the area with two digits after the decimal point.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
100%
should write in c language! (not c++, not c#)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY