Question
1.Define a class to hold information about a single point ( Point class). 2.Write a method of the Point class to determine the distance to
1.Define a class to hold information about a single point (Point class).
2.Write a method of the Point class to determine the distance to another Point.
3.Use composition to define a Circle.
4.Write a method of the Circle classes to determine if a Point is inside the Circle.
5.Write a method of the Circle classes to determine if a Circle is wholly inside another Circle.
6.Write a method of the Circle classes to determine if a circle surrounds another circle. Use the method above.
Write a new class called TestCircle, which contains the main method in order to test your classes. In the main method do the following tasks:
1.Create a circle object
2.Create a point object
3.Print the distance from that point to the centre of the circle.
4.Create a second circle object
5.Find out if the second circle is inside the first one.
Please answer all the Question with Comment
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started