(General math)
a. Write a C++ program to calculate and display the value of the slope of the line connecting two points with the coordinates (3,7) and (8,12). Use the fact that the slope between two points with the coordinates (x1,y1) and (x2,y2) is (y2 - y1) / (x2 - x1).
b. How do you know the result your program produced is correct?
c. After verifying the output your program produces, modify it to determine the slope of the line connecting the points (2,10) and (12,6).
d. What do you think will happen if you use the points (2,3) and (2,4), which results in a division by zero? How do you think this situation can be handled?
e. If your program doesn’t already do so, change its output to this:
The value of the slope is xxx.xxThe xxx.xx denotes placing the calculated value in a field wide enough for three places to the left of the decimal point and two places to the right of it.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.