Question: Rectangle Use the script below as a starting point to create a Rectangle class. Your rectangle class must have the following methods; A constructor that

Rectangle

Use the script below as a starting point to create a Rectangle class. Your rectangle class must have the following methods;

  • A constructor that takes a length and width as parameters
  • getArea - returns the area of the rectangle
  • isSquare - returns True if length and width are equivalent
  • overloaded equivalence - compares the length and width of two rectangles and returns true if they are equivalent
    • NOTE: For the context of this problem; you may compare length to length and width to width. Even though there are other combinations where two squares could be equivalent

Rectangle Use the script below as a starting point to create a

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 Databases Questions!