![]() |
Data Abstraction and Problem Solving with C++Walls and Mirrorsby Frank M. Carrano |
![]() |
Sphere406.hGo to the documentation of this file.00001 00015 class Sphere 00016 { 00017 public: 00018 // constructors: 00019 Sphere(); 00020 Sphere(double initialRadius); 00021 // copy constructor and destructor supplied 00022 // by the compiler 00023 00024 // Sphere operations: 00025 void setRadius(double newRadius); 00026 double getRadius() const; 00027 double getDiameter() const; 00028 double getCircumference() const; 00029 00030 virtual double getArea() const; // surface area 00031 00032 double getVolume() const; 00033 00034 virtual void displayStatistics() const; 00035 00036 private: 00037 double theRadius; // the sphere's radius 00038 }; // end Sphere |