// *************************************************************
// Name:         Mohamed Aboutabl
// Date:         10/12/2004
// Assignment:   Lab 15: CircleTester.java
//
// *************************************************************
// References & Acknowledgements: I received no outside help
//
// *************************************************************
// Name of the class:	CircleTester
// Purpose of the class: Test the new Circle class
// *************************************************************

import cs1.Keyboard ;
import java.text.DecimalFormat ;

public class CircleTester
{
	/**----------------------------------------------------------
	// Test drive the new Circle class and its member methods
	// --------------------------------------------------------*/
	public static void main( String[] args)
	{
		// Variables Declarations
		Circle c1, c2, c3 ;
		double r1, r2, r3 ;

					
		// Get 2 radius values from the user
		System.out.println("Enter the radius for the first circle:");
		r1 = Keyboard.readDouble() ;
		c1 = new Circle( r1 );
		
		System.out.println("Enter the radius for the second circle:");
		r2 = Keyboard.readDouble() ;
		c2 = new Circle( r2 ) ;
		
		// Create a third Circle with random radius
		c3 = new Circle() ;
		
		// Display the three Circles
		System.out.println("\nCircle one");
		displayCircle( c1 ) ;
		
		System.out.println("\nCircle two");
		displayCircle( c2 ) ;
		
		System.out.println("\nA randomly-created Circle");
		displayCircle( c3 ) ;		
						
	}
	
	
	// ---------------------------------------------------
	// Display the Circle object and its attributes
	// ---------------------------------------------------
	static void displayCircle( Circle c )
	{
		DecimalFormat fmt;

		fmt = new DecimalFormat("0.00");

		System.out.println("Radius: " + fmt.format( c.getRadius() ) );
		System.out.println("Circumference: " + fmt.format( c.calcCircumference() ) );
		System.out.println("Area: " + fmt.format( c.calcArea() ) );
	}
}