/******************************************** 
	Circle is a class representing circle-like
    shapes.  
	 
	 @author Nancy Harris, James Madison Univ
	 @version V1 09/26/2007
 *******************************************/
 public class Circle
 {
 	// Circles are defined by their radius
	private double radius;
	
	/****************************************
	 Constructor  Builds a Circle of radius 
	 inRadius.  If the radius is negative, sets 
	 it to 0.
	 
	 @param inRadius The radius of this Circle
	 *****************************************/
	public Circle(double inRadius)
	{
		this.radius = inRadius;
		if (inRadius < 0)  //invalid data
			this.radius = 0; 
	}
	
	/*****************************************
	 getRadius is an accessor method which 
	 returns the radius of this Circle
	 
	 @return radius of this Circle
	 *****************************************/
	public double getRadius()
	{
		return this.radius;
	}
	
	/****************************************
	 getCircumference is an accessor method
	 which calculates and returns the circumference
	 of this circle: cirumference = PI * d where d 
	 is the diameter.  
	 
	 @return The circumference of this Circle object
	 *****************************************/
	 public double getCircumference()
	{
		double circum;
      circum = 2 * this.radius * Math.PI;
		return circum;
	}	

	/*****************************************
	 getAreaCircle calculates and returns the 
	 area of this Circle object using the formula
	 area = PI * r * r
	 
	 @return the area of this Circle 
	*****************************************/
	public double getArea() 
	{
	 	double area;
      area = this.radius * this.radius * Math.PI;
		return area;
	}
	
   /*****************************************
	 getBiggerCircle creates a Circle that is twice the 
    size of this Circle object.
	 
	 @return a Circle which is twice as big as this Circle 
	*****************************************/
	public Circle getBiggerCircle() 
	{
	 	double newRadius;
      
      newRadius = this.radius * 2;
      
      return new Circle(newRadius);
	}
	
	/*****************************************
	 toString provides a representation of this
	 Circle.  Your String should read:
	 A circle of radius, XXXXXX, and area, YYYYY.
	 XXXXXX is replaced by the radius and YYYYY 
	 is replaced by the area.
	 
	 @return String representation of this Circle
	*****************************************/
	public String toString()
	{
		return String.format("A circle of radius, %.2f, and area, %.2f.",
       this.radius, this.getArea());
	}
}