public class Rectangle implements Shape { private double height; private double width; public Rectangle(double width, double height) { this.width = width; this.height = height; } public double area() { return width*height; } public double diameter() { return Math.hypot(width, height); } public double perimeter() { return 2*(height + width); } public int numSides() { return 4; } }