import java.util.Scanner;
/*******************************************************************************
 * CirclePlay contains methods to manipulate Circles
 * It also provides examples of each type of method and
 * proper method documentation
 *
 * @author Nancy Harris
 * @version V1
 *******************************************************************************/
public class CirclePlay
{
	/***************************************************************************
	 * printGreeting prints a simple greeting for the program
	 **************************************************************************/
	
    public static void printGreeting()
    {
        System.out.println("Welcome to the Circle Calculator");
        System.out.println();
        System.out.println("This application will calculate the area "
		     + "of a circle and/or volume of a sphere.");
        System.out.println();
    }

	/************************************************************************
	 * enterRadius prompts the user for a radius and returns what 
	 * they enter.
	 *
	 * @return The radius of the circle
	 ***********************************************************************/
    public static double enterRadius()
    {
        Scanner keyboard;
        double radius;

        keyboard = new Scanner(System.in);

        System.out.print("Enter the radius: ");
        radius = keyboard.nextDouble();

        return radius;
    }
	/***********************************************************************
	 * calculateArea takes in a radius and returns the area of a circle
	 * of that radius.
	 *
	 * @param radius The radius of the circle
	 * @return The area of the circle with that radius
	 **********************************************************************/
    public static double calculateArea(double radius)
    {
        return Math.PI * radius * radius;
    }

	/***********************************************************************
	 * calculateVolume takes in a radius and returns the volume of a sphere
	 * of that radius.
	 *
	 * @param radius The radius of the circle
	 * @return The volume of the sphere with that radius
	 **********************************************************************/
    public static double calculateVolume(double radius)
    {
        return Math.PI * 4.0 / 3.0 * Math.pow(radius, 3);
    }

	/*********************************************************************
	 * format2 formats a double number to have only two decimal positions
	 * 
	 * @param number The number to format
	 * @return A String representing the formatted number
	 *********************************************************************/
    public static String format2(double number)
    {
        return String.format("%.2f", number);
    }
}
