1. Write a complete Java class named Rectangle that allows you to store the minimum information about a rectangle sufficient to write and use the following functions:
• perimeter – returns the perimeter of the rectangle
• area – returns the area of the rectangle
• isSquare – returns true if the rectangle is a square, and false otherwise
• hypotenuse – returns the length of the hypotenuse of the triangle formed by a corner-to-corner bisection of the rectangle.
Users of your class should only be able to interact with the objects of this class via public methods (functions), so all data should be declared to be private. You should also include any other methods necessary, such as methods to populate the member variables of the objects.
2. Write a driver class that demonstrates the functionality of your Rectangle class.
Please find the... View the full answer