Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

IBM Db2 11 1 Certification Guide Explore Techniques To Master Database Programming And Administration Tasks In IBM Db2

Authors: Mohankumar Saraswatipura ,Robert Collins

1st Edition

1788626915, 978-1788626910

More Books

Students also viewed these Databases questions