Define a Rectangle class that also inherits from Quadrilateral, with the following methods: Linit__(self, length, width): Override the _init_. method so that the Rectangle constructor only takes in...


Define a Rectangle class that also inherits from<br>Quadrilateral, with the following methods:<br>Linit__(self, length, width): Override the _init_.<br>method so that the Rectangle constructor only<br>takes in two floating point numbers. Your<br>constructor for Rectangle should only consist of a<br>call to Quadrilateral's constructor: don't define<br>any new instance variables.<br>Override the area method to return the correct<br>area for a rectangle (width*length). Remember:<br>you don't have self.width or self.length instance<br>variables, so you must use the instance variables<br>from Quadrilateral to do this.<br>Do not override the perimeter method: if your<br>init__ is correct then the inherited method<br>from Quadrilateral should work as-is.<br>Examples:<br>>>> isinstance(Rectangle(4, 6), Quadrilateral)<br>True<br>>>> Rectangle(6, 7).area()<br>42<br>

Extracted text: Define a Rectangle class that also inherits from Quadrilateral, with the following methods: Linit__(self, length, width): Override the _init_. method so that the Rectangle constructor only takes in two floating point numbers. Your constructor for Rectangle should only consist of a call to Quadrilateral's constructor: don't define any new instance variables. Override the area method to return the correct area for a rectangle (width*length). Remember: you don't have self.width or self.length instance variables, so you must use the instance variables from Quadrilateral to do this. Do not override the perimeter method: if your init__ is correct then the inherited method from Quadrilateral should work as-is. Examples: >>> isinstance(Rectangle(4, 6), Quadrilateral) True >>> Rectangle(6, 7).area() 42

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here