Question: ( Rectangle Data Type ) Define a data type called Rectangle in rectangle.py that represents a rectangle using 1 D intervals ( ie , Interval
Rectangle Data Type Define a data type called Rectangle in rectangle.py that represents a rectangle using D intervals ie Interval objects to represent its x width and y height segments. The data type must support the following API: Instance variables xinterval of the rectangle, xint Interval yinterval of the rectangle, yint Intervalinitself xint, yint Initialize the instance variables to the values of the corresponding parameters areaself Return the area of this rectangle perimeterself Return the perimeter of this rectangle containsself x y Return True if the rectangle self contains the point xy and False otherwise intersectsself other Return True if the rectangle self intersects the rectangle other and False otherwise strself Return a string representation of the rectangle self
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
