Question: In python ::: 1 - Define the Circle 2 D class that contains: Two double data fields named x ? and y that specify the

In python ::: 1- Define the Circle2D class that contains:
Two double data fields named x? and y that specify the center of the circle with methods. (5points)
A data field radius with a get method. (5 points).
A constructor that creates a circle with the specified x,y, and radius. (5 points)
A method getArea() that returns the area of the circle. (5 points)
A method getPerimeter() that returns the perimeter of the circle. (5 points)
A method contains (x,y) that returns true if the specified point (x,y) is inside this circle. See Figure (a).(15 points)
A method contains1(circle) that returns true if the specified circle is inside this circle. See Figure (b).(15 points)
A method overlaps (circle) that returns true if the specified circle overlaps with this circle. See Figure (c) below. (15 points)
Implement the class.
2- Write a test program
TestCircle2D.py that creates a Circle2D object:
new Circle2D(2,2,5.5)(6 points)
displays its area and perimeter(6 points)
displays the result of c1.contains (3,3)(6) points)
displays the result of c1.contains1(Circle2D(4,5,10.5))(6 points)
displays the result of c1.overlaps(Circle2D(3,5,2.3))(6 points)
In python ::: 1 - Define the Circle 2 D class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!