/**
 * Test driver for the CirclePlay class of Lab04A.
 *
 * @author Nancy Harris
 * @version 09/26/2012
 */
public class CircleDriver
{
    /** main exercises the CirclePlay class
     *
     * @param args gives the number of the method we are testing
     */
    public static void main(String args[])
    {
        int problem;
        double[] fVals = {1.0, 5.0, 10.5};
        
        CirclePlay play;
        
        play = new CirclePlay();

        if (args.length > 0)
        {
            problem = Integer.parseInt(args[0]);
        }
        else
        {
            problem = 0;
        }

        if (problem >= 0)
        {
            System.out.println("Testing Greeting\n");
            play.printGreeting();
        }

        if (problem == 0 || problem >= 2)
        {
            System.out.println("Testing Input\n");
            for (int ii = 0; ii < fVals.length; ii++)
            {
                fVals[ii] = play.enterRadius();
            }

            System.out.print("\nThe values you entered were: ");
            for (int ii = 0; ii < fVals.length; ii++)
            {
                System.out.print(fVals[ii] + "\t");
            }
            System.out.println();
        }

        if (problem == 0 || problem == 3)
        {
            for (int ii = 0; ii < fVals.length; ii++)
            {
                System.out.println("A circle of radius " + fVals[ii] + " has area of "
                                       + play.calculateArea(fVals[ii]) + ".");
            }
        }

        if (problem == 0 || problem == 4)
        {
            for (int ii = 0; ii < fVals.length; ii++)
            {
                System.out.println("A sphere of radius " + fVals[ii] + " has volume of "
                                       + play.calculateVolume(fVals[ii]) + ".");
            }
        }

//        // The code below is commented to be used in the optional exercise.
//        if (problem == 0 || problem == 5)
//        {
//            for (int ii = 0; ii < fVals.length; ii++)
//            {
//                System.out.println("The radius is: " + fVals[ii]
//                                       + " and formatted is: " + play.format2(fVals[ii]));
//            }
//        }
    }
}
