Point/Circle Hierarchy using private data

Class Point3 (Figs. 1-2) declares data members x and y as private and exposes member functions setX, getX, setY, getY and print for manipulating these values.
Figure 1: Point3 class header file. Point/Circle Hierarchy Using private Data
\includegraphics[scale=0.43]{figures/img9.46.ps}
\includegraphics[scale=0.43]{figures/img9.47.ps}
Figure 2: Point3 class uses member functions to manipulate its private data.
\includegraphics[scale=0.43]{figures/img9.48.ps}
\includegraphics[scale=0.43]{figures/img9.49.ps}
Figure 3: Circle4 class header file.
\includegraphics[scale=0.43]{figures/img9.50.ps}
\includegraphics[scale=0.43]{figures/img9.51.ps}
Figure 4: Circle4 class that inherits from class Point3, which does not provide protected data. (part 1 of 2)
\includegraphics[scale=0.43]{figures/img9.52.ps}
\includegraphics[scale=0.43]{figures/img9.53.ps}
Figure 5: Circle4 class that inherits from class Point3, which does not provide protected data. (part 2 of 2)
\includegraphics[scale=0.43]{figures/img9.54.ps}
\includegraphics[scale=0.43]{figures/img9.55.ps}
Figure 6: Base class private data is accessible to a derived class via public or protected member function inherited by the derived class.
\includegraphics[scale=0.43]{figures/img9.56.ps}
\includegraphics[scale=0.43]{figures/img9.57.ps}
2004-07-22