Write a C++ program in this new file. In this new file, write code that will do
Question:
Write a C++ program in this new file. In this new file, write code that will do the following:
(5 points) Create a user-defined data structure (i.e., struct) called Point that represents a two-dimensional Cartesian coordinate (x, y). The member variables of this struct will be just x and y, which are both floating-point values.
(5 points) Define a function called calculateDistance that takes two parameters, each of type Point*(i.e., pointer to Point) and returns the distance between the two given points. As you may recall, the formula for calculating the distance between two points, say p1(x1, y1) and p2(x2, y2) is:
Note: You may use the sqrt() function available in the library for calculating the square root.
(5 points) Write a main function that creates two Point objects, p1 and p2, asks the user to enter the coordinates for these two points, calculates the distance between the two by calling the calculateDistance function, and displays the result.