Question: Design a solution and write its C++ code to compute the slope of the line between the two planar (2D) points (x1, y1) and (x2,

Design a solution and write its C++ code to compute the slope of the line between the two planar (2D) points (x1, y1) and (x2, y2).

Design a solution and write its C++ code to compute the slope of the line between the two planar (2D) points (x1, y1) and (x2, y2).

Hint: The line slope is computed as Y2-Y1x2-x1 . You should check to avoid the case when denominator is zero. Test your solution by using any suitable inputs.

Keep your code commented and indented for ease of reading. Paste your commented codes in the solution and also add a clear screen shot of outcome in your solution.

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!