Data Structure Idle 3.6

Use python idle 3.6 please 


Create a class called Rectangle to represent a rectangle. The class should contain:

· Two fields named width and height.

· A constructor that creates a rectangle with the specified width and height. The default values are 1 and 2 for width and height, respectively.

· The accessor and mutator methods for width and height.

· A method named getArea() that returns the area of the rectangle.

· A method named getPerimeter() that returns the perimeter of the rectangle.

Once you have completed the class, write a program to test it. Be sure to test all methods in the class as well as test the default settings.

Please follow and like us: