1. Exercise 7
• Write a C++ program to calculate and display the slope
of the line connecting the two points with coordinates
(-12,2) and (14,6.5). The formula to calculate the
midpoint of two points are as follows:
• slope = (y2 – y1)/(x2-x1) ;
• Your program should use manipulators to display your
slope value in the following format (with 2 decimal
places and left justified):
• The value of the slope is xxx.xx
1