![]() |
Data Abstraction and Problem Solving with C++Walls and Mirrorsby Frank M. Carrano |
![]() |
Ball406.hGo to the documentation of this file.00001 00015 class Ball : public Sphere 00016 { 00017 public: 00018 // constructors: 00019 Ball(); 00020 00023 Ball(double initialRadius, 00024 const string& initialName); 00025 00026 // copy constructor and destructor supplied 00027 // by the compiler 00028 00029 // additional or revised operations: 00031 void getName(string& currentName) const; 00032 00034 void setName(const string& newName); 00035 00038 void resetBall(double newRadius, 00039 const string& newName); 00040 00042 virtual double getArea() const; 00043 00044 // virtual is redundant but stylistic; 00045 // displayStatistics omitted 00046 00047 private: 00049 string theName; 00050 }; // end Ball |