Exercise Need Implement Two 2 Classes Rectangle Class Rectangletest Class Follows Rectangl Q37199926

For this exercise, you need to implement two (2) classes, theRectangle class and the RectangleTest class, as follows:

 Rectangle class:

o Instance variables:

 A variable named width that stores the width of the rectangleas a double.

 A variable named length that stores the length of therectangle as a double.

o Default constructor:

 Initializes all data fields to default values.

o Overloaded constructor

 Parameters: a width and a length.

 Initializes all data fields to the given values passed by theparameters.

o Method getWidth

 Returns the width of the calling object.

o Method getLength

 Returns the length of the calling object.

o Method setWidth

 Parameter: A width

 Re‐sets

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.