Table of Contents
Chapter 1 -
Introduction to Computers, Problem Solving, and Programming
1.1 Overview of Computers
1.2 Computer Hardware
1.3 Computer Software
1.4 Processing a High-Level Language Program
1.5 The Software Development Method
1.6 Applying the Software Development Method
1.7 Professional Ethics for Computer Programmers
Chapter Review
Interview with Bjarne Stroustrup
Chapter 2 - Overview of C++
2.1 C++ Language Elements
2.2 Reserved Words and Identifiers
2.3 Data Types and Declarations
2.4 Executable Statements
2.5 General Form of a C++ Program
2.6 Arithmetic Expressions
2.7 Interactive Mode, Batch Mode, and Data Files
2.8 Common Programming Errors
Chapter Review
Programming Projects
Interview with Josée Lajoie
Chapter 3 - Top-Down Design with Functions and Classes
3.1 Building Programs from Existing Information
3.2 Library Functions
3.3 Top-Down Design and Structure Charts
3.4 Functions without Arguments
3.5 Functions with Input Arguments
3.6 Scope of Names
3.7 Extending C++ through Classes: Using Class string
3.8 Common Programming Errors
Chapter Review
Programming Projects
Interview with Mark Hall
Chapter 4 - Selection Structures: if and switch Statements
4.1 Control Structures
4.2 Logical Expressions
4.3 Introduction to the if Control Statement
4.4 if Statements with Compound Alternatives
4.5 Decision Steps in Algorithms
4.6 Checking the Correctness of an Algorithm
4.7 Nested if Statements and Multiple-Alternative Decisions
4.8 The switch Control Statement
4.9 Common Programming Errors
Chapter Review
Programming Projects
Chapter 5 - Repetition and Loop Statements
5.1 Counting Loops and the while Statement
5.2 Accumulating a Sum or Product in a Loop
5.3 The for Statement
5.4 Conditional Loops
5.5 Loop Design and Loop Patterns
5.6 The do-while Statement
5.7 Review of while, for, and do-while Loops
5.8 Nested Loops
5.9 Debugging and Testing Programs
5.10 Common Programming Errors
Chapter Review
Programming Projects
Interview with Mike Weisert
Chapter 6 - Modular Programming
6.1 Value and Reference Parameters
6.2 Functions with Output and Input Parameters
6.3 Stepwise Design with Functions
6.4 Using Objects with Functions
6.5 Debugging and Testing a Program System
6.6 Recursive Functions (Optional)
6.7 Common Programing Errors
Chapter Review
Programming Projects
Intervew with Robert Sebesta
Chapter 7 - Simple Data Types
7.1 Constants Revisited
7.2 Internal Representations of Numeric Data Types
7.3 Character Data and Functions
7.4 Type bool Data and Logical Expressions
7.5 Enumeration Types
7.6 Common Programming Errors
Chapter Review
Programming Projects
Interview with Thomas Drake
Chapter 8 - Streams and Files
8.1 The Standard Input/Output Streams
8.2 External Files
8.3 Using External Files for Communication between Programs
8.4 More on Reading String Data
8.5 Input/Output Manipulators
8.6 Common Programming Errors
Chapter Review
Programming Projects
Interview with Anita Borg
Chapter 9 - Data Structures:Arrays and Structs
9.1 The Array Data Type
9.2 Sequential Access to Array Elements
9.3 Array Arguments
9.4 Reading Part of an Array
9.5 Searching and Sorting Arrays
9.6 Analyzing Algorithms: Big-O Notation
9.7 The Struct Data Type
9.8 Structs as Operands and Arguments
9.9 Strings as Arrays of Characters (Optional)
9.10 Common Programming Errors
Chapter Review
Programming Projects
Chapter 10 - User-Defined Classes
10.1 Class Definition and Use
10.2 Class Implementation
10.3 Summary of Rules for Use of Classes and Objects
10.4 Classes as Operands and Arguments
10.5 A Fraction Class
10.6 A Circle Class
10.7 A Simple String Class
10.8 A Savings Account Class
10.9 Common Programming Errors
Chapter Review
Programming Projects
Interview with Timothy Budd
Chapter 11 - Data Abstraction and Object-Oriented Design
11.1 Multidimensional Arrays
11.2 Array of Structs
11.3 Template Classes
11.4 The Indexed List Abstract Data Type
11.5 Implementing the Indexed List Class
11.6 Illustrating Object-Oriented Design
11.7 Operator Overloading and Friends
11.8 The vector Class
11.9 Common Programming Errors
Chapter Review
Programming Projects
Interview with John Lakos
Chapter 12 — Recursion
12.1 The Nature of Recursion
12.2 Tracing Recursive Functions
12.3 Recursive Mathematical Functions
12.4 Recursive Functions with Array Arguments
12.5 Problem Solving with Recursion
12.6 Common Programming Errors
Chapter Review
Programming Projects
Interview with Marshall Cline
Chapter 13 - Pointers and Dynamic Data Structures
13.1 Pointers and the new Operator
13.2 Manipulating the Heap
13.3 Linked Lists and the list Class
13.4 The Stack Abstract Data Type
13.5 The Queue Abstract Data Type
13.6 Binary Trees
13.7 Binary Search Tree Abstract Data Type
13.8 Efficiency of a Binary Search Tree
13.9 Common Programming Errors
Chapter Review
Programming Projects
Chapter 14 - Multiprocessing Using Processes and Threads
14.1 Multitasking
14.2 Processes
14.3 Interprocess Communications and Pipes
14.4 Threads
14.5 Common Programming Errors
Chapter Review
Programming Projects
Appendix A ASCII Character Set
Appendix B Reserved Words and Special Characters
Appendix C Selected C++ Library Facilities
Appendix D Operators
Appendix E A Brief Introduction to Inheritance
and Polymorphism
Answers to Odd-Numbered Questions
Index