Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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: circle2 is inside circle1 if the distance between the two centers + r2<= r1 and circle2
overlaps circle1 if the distance between the two centers <= r1+ r2.
Test your program to cover all cases.)
Sample three runs:
Enter circle1's center x coordinate: 0.5
Enter circle1's center y-coordinates: 5.1
Enter circle1's radius: 13
Enter circle2's center x coordinate: 1.0
Enter circle2's center y-coordinates: 1.7
Enter circle2's radius: 4.5
circle2 is inside circle1
Enter circle1's center x coordinate: 4.4
Enter circle1's center y-coordinates: 5.7
Enter circle1's radius: 5.5
Enter circle2's center x coordinate: 6.7
Enter circle2's center y-coordinates: 3.5
Enter circle2's radius: 3
circle2 overlaps circle1
Enter circle1's center x coordinate: 4.4
Enter circle1's center y-coordinates: 5.5
Enter circle1's radius: 1
Enter circle2's center x coordinate: 5.5
Enter circle2's center y-coordinates: 7.2
Enter circle2's radius: 1
circle2 does not overlap circle1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

U11 Informing Industry: Publicizing Contract Actions 317

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago