/**
*  written by Elizabeth Adams for Lab 14 Key CS239 Spring 2005
*/

public class Sphere extends Circle
{
   private double myRadius;
	 
    /**
	 *   computes the surface area of a sphere
	 *   @param  radius of the sphere
	 */

    public Sphere (double radius)
	 {
	     super(radius, "Sphere");
	     myRadius = radius;
	 }   
	 /**
	 *   method to override the method in parent Circle
	 *   which computes the area of a circle
	 *   
	 *   @returns the surface area of a sphere
	 *  
    */
	 public double getArea( )
	 {
	  //  Surface Area of a Sphere = 4 pi r 2 

	    double myArea;

	//	 myArea =4*Math.PI*myRadius*myRadius;
       myArea = 4*super.getArea();
		 return myArea;
	 }
	 
	 //The volume of a sphere can be found by the formula: 
 	 // volume = 4/3 pi r3 

  	 public double getVolume( )
	 {
	     double myVolume;
	   //  myVolume = (4*super.getArea()*myRadius)/3;
       myVolume = (4/3)*Math.PI * myRadius*myRadius*myRadius;
  //   myVolume = (4 * Math.PI * myRadius*myRadius*myRadius)/3;
		  return myVolume;
		  
	 }// end getVolume

}// end class	 