001 package classwork;
002 /**
003 * Models a circle.
004 * @author Tom James
005 *
006 */
007 public class Circle {
008 /**
009 * @param radius The distance between the center of the circle and its edge.
010 */
011 public Circle(int radius)
012 {
013 this.radius = radius;
014 }
015 /**
016 * @return The area of the circle.
017 */
018 public double getArea() {
019 double area = radius * radius * Math.PI;
020 //System.out.println(area);
021 return area;
022 }
023 /**
024 * @return The circumference of the circle.
025 */
026 public double getPerimeter() {
027 double perimeter = 2 * Math.PI * radius;
028 return perimeter;
029 }
030 /**
031 * The distance between the center of the circle and its edge.
032 */
033 private int radius;
034 }