Question: In C language Implement main with an array of 5 points (marks), reads in 4 points from the user by calling getLabel() 4 times. Find

In C language

Implement main with an array of 5 points (marks), reads in 4 points from the user by calling getLabel() 4 times.

Find and display the distance (gap) between the 1st and 2nd points, and 3rd and 4th points using function gap.

Find and display the slope of the line between the 1st and 2nd points, and the 3rd and 4th points using function slope.

Create a 5th point by calling perpLabel() using 1st and 2nd points.

Code is provided below

_____________________________________________________________________________________________________________________________________________________________

#include #include #include #include

struct mark_struc { double xax; double yaz; char tag[25]; }; typedef struct mark_struc Label;

Label getLabel(); // get a point(Label) from the user (stdin)

double gap(Label mk1, Label mk2); // return the distance between mk1 (point1) and mk2(point2)

double slope(Label mk1, Label mk2); /* find slope of the line at mk1 and going to mk2 */

void perpLabel (Label mk1, Label mk2, Label *mk3); /* calculate the pt3 from mk1 to mk3 is perpendicular to the line from mk1 to mk2 */ int main() { Label aArray[5]; //finsh main return 0; }

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!