Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions 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.
expand button
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
Check Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY