Question: Write a program that prompts the user to enter the center coordinates and radius of two circles and determines whether the second circle is inside
Write a program that prompts the user to enter the center coordinates and radius of two circles
and determines whether the second circle is inside the first or overlaps with the first, as shown in
the below figure.
Hint: circle is inside circle if the distance between the two centers r r and circle
overlaps circle if the distance between the two centers r r
Test your program to cover all cases.
Sample three runs:
Enter circles center x coordinate:
Enter circles center ycoordinates:
Enter circles radius:
Enter circles center x coordinate:
Enter circles center ycoordinates:
Enter circles radius:
circle is inside circle
Enter circles center x coordinate:
Enter circles center ycoordinates:
Enter circles radius:
Enter circles center x coordinate:
Enter circles center ycoordinates:
Enter circles radius:
circle overlaps circle
Enter circles center x coordinate:
Enter circles center ycoordinates:
Enter circles radius:
Enter circles center x coordinate:
Enter circles center ycoordinates:
Enter circles radius:
circle does not overlap circle
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
