/** File: Square.java * Copy: Copyright (c) 1998 David Green * Vers: 1.0.2 2001/05/15 dgg -- original coding * Vers: 1.0.5 2006/11/16 sma -- Documentation standards for Java source code */ public class Square extends Shape { /** * Side length of the square */ protected int side; /** * Constructor */ private Square() { } /** * Method to create a square with a name and side length. */ public Square( String a_name, int a_side ) { name = a_name; side = a_side; } /** * Method to calculate and to return the area of the square. */ public int getArea() { return side * side; } /** * Method to return the name of the square. */ public String getName() { return name; } /** * Method to return the side length of the square. */ public int getSide() { return side; } /** * Method to resize the square by a percentage. */ public void resize( int percentage ) { side = ( side * (100 + percentage) ) / 100; } }