Design a class named Rectangle to represent a rectangle. The class contains the following. 1. Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both fields. 2. A no-arg constructor that creates a default rectangle. 3. A constructor that creates a rectangle with the specified width and height. 4. A method named getArea() that returns the area of the rectangle. 5. A named method getPerimeter() that returns the perimeter. Draw the UML diagram for the class and include it in your report. Implement the class. Write a test or application program that creates two Rectangle objects—one with width 4 and height 40, and the other with width 3.5 and height 35.9. Display the width, height, area and perimeter of each rectangle in this order Solution Rectangle.java public class Rectangle { private double width; private double height; private final double PI = 3.14; public Rectangle(){ } public Rectangle(double width, double height){ this.width = width; this.height = height; } public double getArea(){ return width * height; } public double getWidth() { return width; } public void setWidth(double width) { this.width = width; } public double getHeight() { return height; } public void setHeight(double height) { this.height = height; } public double getPerimeter(){ return 2 * (height + width); } public String toString(){ return String.format(\"Rectangle: Area = %.2f , Perimeter = %.2f \",getArea(),getPerimeter()); } } RectangleTest.java public class RectangleTest { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Rectangle r1 = new Rectangle(); r1.setWidth(4); r1.setHeight(40); Rectangle r2 = new Rectangle(); r2.setWidth(3.5); r2.setHeight(35.9); System.out.println(\"Rectangle Width \"+r1.getWidth()+\" Height :\"+r1.getHeight()); System.out.println(r1.toString()); System.out.println(\"Rectangle Width \"+r2  .getWidth()+\" Height :\"+r2.getHeight()); System.out.println(r2.toString()); } } Output: Rectangle Width 4.0 Height :40.0 Rectangle: Area = 160.00 , Perimeter = 88.00 Rectangle Width 3.5 Height :35.9 Rectangle: Area = 125.65 , Perimeter = 78.80 .