// class to find the area of a circle
// Author Chirs IOAKIM
// Circle has a field r which defaults to 1and may be set between 0 and 20

public class Circle
{
	public double circleArea;
	public int r=1; // defines the value r and sets it to 1
	
	
	//constructor
	public Circle(double r)
	{
		setCircleArea(r);
	}	
	
	//method
	public void setCircleArea(double r)
	{
		if (r>=0&&r<=20) // test if the users input is between 0 and 20
		{
			circleArea=(r*r)*3.14;
		}
		
		else
		{
			System.out.println("Please enter a number between 0 and 20");
			System.out.println("Radius has been set to it's default value of 1");
			r=1; // sets the radius back to 1
			circleArea = (r*r)*3.14;
		}
	}// end the method			
	
	
	public double getCircleArea()
	{
		return circleArea;
	}	
	
}// ends the class	