Write the definition ofa class named Rectangleto represents rectangles. The clas
ID: 3608400 • Letter: W
Question
Write the definition ofa class named Rectangleto represents rectangles. The classshould contain two
private datafields int widthand int height. The defaultvalues for widthand height are both1.
Your class shouldcontain the following public methods:
•Rectangle(): the default constructor which constructs a defaultrectangle.
•Rectangle(int w, inth): a constructor whichconstructs a rectangle with the given width and
height.
•void setWidth(int w)
•int getWidth()
•void setHeight(int h)
•int getHeight()
•int getArea()
•int getPerimeter()
•bool isSquare()
In addition, you should write acomplete set of unit tests to test your class.