Write a full C++ program that when abandoned the x and y coordinates of brace tops on a direction, the program calculates and evidences the slope and the midpoint of that direction.
Your output should evidence the peculiar brace tops, the expand and the midtop in a acquitted arranged carriage.
The abandoned C++ program takes the object coordinates of the direction- x1,y1 and x2,y2.
It then calculates the expand of the direction using sickly formula, expand = (x2-x1)/(y2-y1).
And the mid top using the mid-top formula: midx = (x1+x2)/2 and midy = (y1+y2)/2.
using namespace std;
float x1, x2, y1, y2;
float midx, midy;
cout<<“Enter the x1, y1 coordinates:n”;
cout<<“Enter the x2, y2 coordinates:n”;
expand = (x2-x1)/(y2-y1);
midx = (x1+x2)/2;
midy = (y1+y2)/2;
cout<<“The entered tops of the direction are:n”;
cout<<“(“<<x1<<“,”<<y1<<“) and “;
cout<<“nThe expand of the direction is: “<<slope;
cout<<“nThe midtop of the direction is: (“<<midx<<“,”<<midy<<“)”;