Question: C++ Program Write a program to calculate the slope between two points x 1, y 1 and x 2, y 2. The points should be

C++ Program

Write a program to calculate the slope between two points x1, y1 and x2, y2. The points should be entered as four double values in the order x1, y1, x2, and y2.

The formula to calculate the slope, m, between two points is,

m = y2 - y1 / X2 - X1

Output the calculated slope value.

Use this value to output the equation of the line in the form

y 5 mx 1 c

You can calculate the value of c from one of the pair of points entered as

input.

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!