The C++ Programming Language, Fourth Edition by Bjarne Stroustrup

The C++ Programming Language, Fourth Edition by Bjarne Stroustrup

Author:Bjarne Stroustrup
Language: eng
Format: epub
Publisher: Addison-Wesley Professional
Published: 2013-03-24T16:00:00+00:00


21.2. Design of Class Hierarchies

Consider a simple design problem: Provide a way for a program (“an application”) to get an integer value from a user. This can be done in a bewildering number of ways. To insulate our program from this variety, and also to get a chance to explore the possible design choices, let us start by defining our program’s model of this simple input operation.

The idea is to have a class Ival_box (“integer value input box”) that knows what range of input values it will accept. A program can ask an Ival_box for its value and ask it to prompt the user if necessary. In addition, a program can ask an Ival_box if a user changed the value since the program last looked at it:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.