Write a program that lets the user enter the coordinates of the center and radius of two circles, circle 1 with center coordinates at (x ) and circle 2 with center coordinates at (X. y). The program then determines whether circle 2 is inside circle 1 or overlaps with circle 1. rl • (x1, y1) • (x1, y1) 12 (x2, y2) (x2, y2) Circle 2 is found to be inside circle 1 if distance between the centers is <-lradius icte- radiusinte and circle 2 is said to overiap circle one if the distance between the two centers is <-radius + radius circe2 circel Test Cases: Enter center coordinates (x, y) and radius of circle 1:0.55.1 13 Enter center coordinates (x, y) and radius of circle 2: 11.74.5 Circle 2 is inside of circle 1 Enter center coordinates (x, y) and radius of circle 1:3.4 5.7 5.5 Enter center coordinates (x, y) and radius of circle 2: 6.7 3.53 Circle 2 overlaps circle 1 Enter center coordinates (x, y) and radius of circle 1: 3.5 5.51 Enter center coordinates (x, y) and radius of circle 2: 5.5 7.21 Circle 2 does not overlap circle 1 Submit a .txt file of your program in the submission bin or paste the entire code as a text submission.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Assignment Content
Write a program that lets the user enter the coordinates of the center and radius of two circles, circle 1 with center coordinates at (* Y1 and circle 2 with center coordinates at (X y,). The program then determines whether circle 2 is inside circle 1 or overlaps with circle 1.
rl
rl
• (x1, y1)
(x1, y1)
(x2, y2),
(x2, y2)
Circle 2 is found to be inside circle 1 if distance between the centers is <=Tradius
circle1
- radius
cirede and circle 2 is said to overlap circle one if the distance between the two centers is <=radius
circle1
+ radius
circle2-
Test Cases:
Enter center coordinates (x, y) and radius of circle 1:0.5 5.1 13
Enter center coordinates (x, y) and radius of circle 2:11.7 4.5
Circle 2 is inside of circle 1
Enter center coordinates (x, y) and radius of circle 1:3
75.5
Enter center coordinates (x, y) and radius of circle 2: 6.7 3.5 3
Circle 2 overlaps circle 1
Enter center coordinates (x, y) and radius of circle 1:3.55.5 1
Enter center coordinates (x, y) and radius of circle 2: 5.5 7.2 1
Circle 2 does not overlap circle 1
Submit a txt file of your program in the submission bin or paste the entire code as a text submission.
Transcribed Image Text:Assignment Content Write a program that lets the user enter the coordinates of the center and radius of two circles, circle 1 with center coordinates at (* Y1 and circle 2 with center coordinates at (X y,). The program then determines whether circle 2 is inside circle 1 or overlaps with circle 1. rl rl • (x1, y1) (x1, y1) (x2, y2), (x2, y2) Circle 2 is found to be inside circle 1 if distance between the centers is <=Tradius circle1 - radius cirede and circle 2 is said to overlap circle one if the distance between the two centers is <=radius circle1 + radius circle2- Test Cases: Enter center coordinates (x, y) and radius of circle 1:0.5 5.1 13 Enter center coordinates (x, y) and radius of circle 2:11.7 4.5 Circle 2 is inside of circle 1 Enter center coordinates (x, y) and radius of circle 1:3 75.5 Enter center coordinates (x, y) and radius of circle 2: 6.7 3.5 3 Circle 2 overlaps circle 1 Enter center coordinates (x, y) and radius of circle 1:3.55.5 1 Enter center coordinates (x, y) and radius of circle 2: 5.5 7.2 1 Circle 2 does not overlap circle 1 Submit a txt file of your program in the submission bin or paste the entire code as a text submission.
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY