P2: Two Circles

Write a program that prompts the user to enter the center coordinates and radii of two circles and determines whether the second circle is inside the first or overlaps with the first, as shown in the figure below. (Hint: circle2 is inside circle1 if the distance between the two centers <= |r1 - r2| and circle2 overlaps circle1 if the distance between the two centers <= |r1 + r2|. Test your program to cover all cases. Use Math.sqrt() to calculate the square root of a number)

Enter circle1's center x-, y-coordinates, and radius: 0.5 5.1 13 
Enter circle2's center x-, y-coordinates, and radius: 1 1.7 4.5 
circle2 is inside circle1

Enter circle1's center x-, y-coordinates, and radius: 3.4 5.7 5.5 
Enter circle2's center x-, y-coordinates, and radius: 6.7 3.5 3 
circle2 overlaps circle1

Enter circle1's center x-, y-coordinates, and radius: 3.4 5.5 1 
Enter circle2's center x-, y-coordinates, and radius: 5.5 7.2 1 
circle2 does not overlap circle1

The file should be named in this format: P2_YourName.txt, for example, P2_JohnDoe.txt. Then submit to the Blackboard (Bb) as attachment by the deadline. The submission link on the Bb will be closed automatically after the deadline. Assignments that fail to follow the instructions will NOT be graded.