Write a finished C++ program that when loving the x and y coordinates of brace summits on a cord, the program calculates and spread-outs the slope and the midpoint of that cord.
Your output should spread-out the primordial brace summits, the arise and the midsummit in a lucid arranged behavior.
The loving C++ program takes the purpose coordinates of the cord- x1,y1 and x2,y2.
It then calculates the arise of the cord using unsophisticated formula, arise = (x2-x1)/(y2-y1).
And the mid summit using the mid-summit 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”;
arise = (x2-x1)/(y2-y1);
midx = (x1+x2)/2;
midy = (y1+y2)/2;
cout<<“The entered summits of the cord are:n”;
cout<<“(“<<x1<<“,”<<y1<<“) and “;
cout<<“nThe arise of the cord is: “<<slope;
cout<<“nThe midsummit of the cord is: (“<<midx<<“,”<<midy<<“)”;