Question: roblem: Troblem: The Circle Design a class which represents a Circle in the ( x , y ) coordinate plane. A Circle object is initialized
roblem: Troblem: The Circle
Design a class which represents a Circle in the xy coordinate plane. A Circle object is initialized with
three input arguments. The center of the circle specified as the first two inputs xy and the radius of
the circle. By default, the circle will be centered at with a radius of that would be implemented
in the constructor The constructor should be consistent with the following logic:
c Circle # circle centered at with r
c Circle # circle centered at with r
c Circle # circle centered at with r
c Circle # circle centered at with r
A negative radius input should raise a ValueError with a proper message.
Action Methods
The Circle class should provide proper getterssetters for the x and y coordinates of the center as well as
the radius getRadius getX, getY, setRadius, setX, setY
Action Methods
The Circle class should implement the following member functions:
def calcArea: return the area of the circle as float
def calcPerimeter: return the perimeter of the circle as float
def isPointWithinCirclexy: returns TrueFalse
Overloading Methods
def eqself other returns True if the circles have same x y r
def neself other
Stream IO
The class must print out the following representation of itself when passed to the print
function: x y r For example, if c Circle then printc would print the string
without the double quoteshe Circle
Design a class which represents a Circle in the xy coordinate plane. A Circle object is initialized with
three input arguments. The center of the circle specified as the first two inputs xy and the radius of
the circle. By default, the circle will be centered at with a radius of that would be implemented
in the constructor The constructor should be consistent with the following logic:
c Circle # circle centered at with r
c Circle # circle centered at with r
c Circle # circle centered at with r
c Circle # circle centered at with r
A negative radius input should raise a ValueError with a proper message.
Action Methods
The Circle class should provide proper getterssetters for the x and y coordinates of the center as well as
the radius getRadius getX, getY, setRadius, setX, setY
Action Methods
The Circle class should implement the following member functions:
def calcArea: return the area of the circle as float
def calcPerimeter: return the perimeter of the circle as float
def isPointWithinCirclexy: returns TrueFalse
Overloading Methods
def eqself other returns True if the circles have same x y r
def neself other
Stream IO
The class must print out the following representation of itself when passed to the print
function: x y r For example, if c Circle then printc would print the string
without the double quotes
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
