/**
 * Test driver for the CirclePlay class of Lab05B.
 *
 * @author Nancy Harris
 * @version 09/26/2012
 */
public class CircleDriver
{
    public static void main(String args[])
    {
        int problem;
        double[] fVals = {1.0, 5.0, 10.5};

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

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

        if (problem == 0 || problem >= 2)
        {
            System.out.println("Testing Input\n");
            for (int ii = 0; ii < fVals.length; ii++)
            {
                fVals[ii] = CirclePlay.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 "
                                       + CirclePlay.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 "
                                       + CirclePlay.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.lenth; ii++)
//            {
//                System.out.println("The radius is: " + fVals[ii]
//                                       + " and formatted is: " + CirclePlay.format2(fVals[ii]));
//            }
//        }
    }
}
