/* Class: Shape Author: Mr. F Date: 9/25/07 */ public abstract class Shape { private double xCenter, yCenter; //constructs a shape with the given center public Shape(double x, double y) { xCenter = x; yCenter = y; } //returns the area of the shape public abstract double area(); //returns the perimeter of the shape public abstract double perimeter(); //returns the number of sides of the shape public abstract int numberOfSides(); //returns the ratio of the area to the perimeter public double ratio() { return area() / perimeter(); } public double getXCenter() { return xCenter; } public double getYCenter() { return yCenter; } }