Create a NOTEPAD or PDF file that restates the problem in your own words, specif
ID: 3786247 • Letter: C
Question
Create a NOTEPAD or PDF file that restates the problem in your own words, specifies what input needed, what output is expected, the step by process (algorithm) to get the output from the input, and test data (input for which you know the expected output for each of the 3 problems given below. You should not write any actual C++ code. Make sure the problem statement is in your own words and is descriptive enough so someone not reading the problem given to you will understand what needs to be done. (See the document containing example algorithms posted on Canvas). Attach your file to the Algorithms 2 drop box on Canvas. A point is considered to be inside a circle if the point's distance from the center is less than or equal to the radius. Create a process that will take (x, y) coordinates for the center of a circle, the radius of the circle, and the (x, y) coordinates of a point then determine whether the point is inside the circle.Explanation / Answer
Here is the algorithm for you:
Algorithm PointInOrOutOfCircle(centX, centY, radius, X, Y)
//Input: The centX, centY points which represent the center of the circle,
// The radius which represents the radius of the circle.
// The X, Y points which represent the point to be decided on.
//Output: Returns true if the point is inside the circle, false otherwise.
dist = sqrt((centX - X)^2 + (centY - Y)^2) //Calculates the distance between the two points.
if(dist <= radius) //If the points distance from center is less than or equal to radius
return true; //Conclude the point is inside the circle, and return true.
return false; //Return false otherwise.