/** File: Circle.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 Circle extends Shape { /* * radius of circle */ protected int radius; /** * Constructor */ private Circle() { } /** * Make a circle with a name and radius. */ public Circle( String a_name, int a_radius ) { name = a_name; radius = a_radius; } /** * Calculates the area of the circle. */ public int getArea() { /* * estimate pi as 3.14 */ return ( 314 * radius * radius ) / 100; } /** * Method to return the name of the circle. */ public String getName() { return name; } /** * Method to return the radius of the circle. */ public int getRadius() { return radius; } /** * Method to resize the circle by percentage. */ public void resize( int percentage ) { radius = ( radius * (100 + percentage) ) / 100; } }