Chapter 1 introduced the problem-solving methodology called object-oriented design
(OOD). In OOD, the first step is to identify the components, called objects. An object
combines data and the operations on that data in a single unit. In C++, the mechanism
that allows you to combine data and the operations on that data in a single unit is called a
class. Now that you know how to store and manipulate data in computer memory and
how to construct your own functions, you are ready to learn how objects are constructed.
This and subsequent chapters develop and implement programs using OOD. This chapter
first explains how to define a class and use it in a program.
A class is a collection of a fixed number of components. The components of a class are
called the members of the class.
The general syntax for defining a class is: