// *************************************************** // Header file Sphere.h for the class sphereClass. // *************************************************** const double PI = 3.14159; class sphereClass { public: sphereClass(); // Default constructor: Creates a sphere and // initializes its radius to a default value. // Precondition: None. // Postcondition: A sphere of radius 1 exists. sphereClass(double InitialRadius); // Constructor: Creates a sphere and initializes // its radius. // Precondition: InitialRadius is the desired // radius. // Postcondition: A sphere of radius InitialRadius // exists. void SetRadius(double NewRadius); // Sets (alters) the radius of an existing sphere. // Precondition: NewRadius is the desired radius. // Postcondition: The sphereÕs radius is NewRadius. double Radius() const; // Determines a sphere's radius. // Precondition: None. // Postcondition: Returns the radius. double Diameter() const; // Determines a sphere's diameter. // Precondition: None. // Postcondition: Returns the diameter. double Circumference() const; // Determines a sphere's circumference. // Precondition: PI is a named constant. // Postcondition: Returns the circumference. double Area() const; // Determines a sphere's surface area. // Precondition: PI is a named constant. // Postcondition: Returns the surface area. double Volume() const; // Determines a sphere's volume. // Precondition: PI is a named constant. // Postcondition: Returns the volume. void DisplayStatistics() const; // Displays statistics of a sphere. // Precondition: None. // Postcondition: Displays the radius, diameter, // circumference, area, and volume. private: double TheRadius; // the sphereÕs radius }; // end class // End of header file.