Write a program that creates the output shown in the Output Layout section below. The program should create 2 points with x and y coordinates as integers, prompt the user to input the x and y values for one of the points and randomly set the other (-99 to 99 range) and output the length of the radius line segment and the area of the circle that radius defines. The program should then end. Include an SDM for the program and any other appropriate documentation.
Special Calculations:
Distance between 2 points equation:
√((p0x – p1x)2 + (p0y – p1y)2) (This requires use of the math library)
Output Layout: (bold text represents user input)
Please enter the location of your first point.
Enter a value from -99 to 99 for your x coordinate: -2
Enter a value from -99 to 99 for your y coordinate: 17
The location of your second randomly set point.
Your x coordinate: 45
Your y coordinate: -89
The length of the radius line segment from point one to point two is 115.
The area of the circle with a radius of 115 is 41546.33.
cout << "\n The coordinates of the second point are\n ";
cout << "X: " << x2 << "\n";
cout << "y: " << y2 << "\n\n";
cout << " The lenght of the radius line segment is: " << lenght << "\n";
cout << " The area of the circle is: " << area << "\n\n";
2) You shouldn't divide lenght by 2, it is already radius you want. Now it isn't the same as in example:
Enter a value from -99 to 99 for your x coordinate:-2
Enter a value from -99 to 99 for your y oordiante:17
The coordinates of the second point are
X: 45
y: -89
The lenght of the radius line segment is: 115.953
The area of the circle is: 10559.7
And don't forget to use code tags (they looks like that: <>)