xviii Preface
Brief Overview of Each Chapter
Chapter 1: Introduction to Computers and Programming
This chapter provides an introduction to the field of computer science and covers the
fundamentals of hardware, software, operating systems, programming, problem solving,
and software engineering. The components of programs, such as key words, variables,
operators, and punctuation are covered. The tools of the trade, such as hierarchy charts
and pseudocode, are also presented. The new Tying It All Together section shows stu-
dents how to use the cout statement to create a personalized output message. Two new
Programming Challenges help students see how the same basic input, processing, and
output structure can be used to create multiple programs.
Chapter 2: Introduction to C++
This chapter gets the student started in C++ by introducing the basic parts of a C++ program,
data types, variable definitions, assignment statements, constants, comments, program output,
and simple arithmetic operations. The C++ string class is presented and string objects are used
from this point on in the book as the primary method of handling strings. Programming style
conventions are introduced and good programming style is modeled here, as it is throughout
the text. An optional section explains the difference between ANSI standard and prestandard
C++ programs. The new Tying It All Together section lets the student play with simple text-
based graphics.
Chapter 3: Expressions and Interactivity
In this chapter the student learns to write programs that input and handle numeric, character,
and string data. The use of arithmetic operators and the creation of mathematical expressions
are covered, with emphasis on operator precedence. Debugging is introduced, with a section
on hand tracing a program. Sections are also included on using random numbers, on reading
and writing sequential files, on simple output formatting, on data type conversion and type
casting, and on using library functions that work with numbers. For those who wish to
cover them, there is also a section on C-strings. The new Tying It All Together section
shows students how to create a simple interactive word game.
Chapter 4: Making Decisions
Here the student learns about relational expressions and how to control the flow of a
program with the if, if/else, and if/else if statements. Logical operators, the
conditional operator, and the switch statement are also covered. Applications of these
constructs, such as menu-driven programs, are illustrated. This chapter also continues
the theme of debugging with a section on validating output results. The new Tying It
All Together section uses random numbers and branching statements to create a for-
tune telling game.
Chapter 5: Looping
This chapter covers C++’s repetitive control mechanisms. The while loop, do-while loop,
and for loop are taught, along with a variety of methods to control them. These include
using counters, user input, end sentinels, and end-of-file testing. Applications utilizing
loops, such as keeping a running total and performing data validation, are covered. The
emphasis on testing and debugging continues, with a section on creating good test data.
The new Tying It All Together section introduces students to Windows commands to cre-
ate colorful output and uses a loop to create a multi-colored display.