Point/Circle Hierarchy using private data

Class Point3 (Figs. 4.20-4.21) declares data members x and y as private and exposes member functions setX, getX, setY, getY and print for manipulating these values.
Figure 4.20: 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 4.21: 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 4.22: Circle4 class header file.
\includegraphics[scale=0.43]{figures/img9.50.ps}
\includegraphics[scale=0.43]{figures/img9.51.ps}
Figure 4.23: 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 4.24: 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 4.25: 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-29