1.1 Introduction 2
1.2 What is a Computer? 5
1.3 Computer Organization 5
1.4 Evolution of Operating Systems 6
1.5 Personal Computing, Distributed Computing and Client/Server Computing
7
1.6 Machine Languages, Assembly Languages, and High-level Languages 8
1.7 History of C and C++ 9
1.8 C++ Standard Library 10
1.9 Java and Java How to Program 11
1.10 Other High-level Languages 11
1.11 Structured Programming 12
1.12 The Key Software Trend: Object Technology 12
1.13 Basics of a Typical C++ Environment 15
1.14 Hardware Trends 17
1.15 History of the Internet 18
1.16 History of the World Wide Web 19
1.17 General Notes About C++ and This Book 19
1.18 Introduction to C++ Programming 20
1.19 A Simple Program: Printing a Line of Text 21
1.20 Another Simple Program: Adding Two Integers 25
1.21 Memory Concepts 29
1.22 Arithmetic 30
1.23 Decision Making: Equality and Relational Operators 34
1.24 Thinking About Objects: Introduction to Object Technology and the
Unified Modeling Language 38
2.1 Introduction 59
2.2 Algorithms 60
2.3 Pseudocode 60
2.4 Control Structures 61
2.5 The if Selection Structure 63
2.6 The if/else Selection Structure 65
2.7 The while Repetition Structure 69
2.8 Formulating Algorithms: Case Study 1
(Counter-Controlled Repetition) 70
2.9 Formulating Algorithms with Top-Down, Stepwise Refinement:
Case Study 2 (Sentinel-Controlled Repetition) 73
2.10 Formulating Algorithms with Top-Down, Stepwise Refinement:
Case Study 3 (Nested Control Structures) 81
2.11 Assignment Operators 85
2.12 Increment and Decrement Operators 86
2.13 Essentials of Counter-Controlled Repetition 88
2.14 The for Repetition Structure 91
2.15 Examples Using the for Structure 95
2.16 The switch Multiple-Selection Structure 99
2.17 The do/while Repetition Structure 105
2.18 The break and continue Statements 107
2.19 Logical Operators 109
2.20 Confusing Equality (==) and Assignment (=) Operators 113
2.21 Structured-Programming Summary 114
2.22 [Optional Case Study] Thinking About Objects: Identifying the Classes
in a Problem 119
3.1 Introduction 158
3.2 Program Components in C++ 158
3.3 Math Library Functions 159
3.4 Functions 160
3.5 Function Definitions 162
3.6 Function Prototypes 166
3.7 Header Files 168
3.8 Random Number Generation 170
3.9 Example: A Game of Chance and Introducing enum 176
3.10 Storage Classes 179
3.11 Scope Rules 182
3.12 Recursion 185
3.13 Example Using Recursion: The Fibonacci Series 188
3.14 Recursion vs. Iteration 192
3.15 Functions with Empty Parameter Lists 194
3.16 Inline Functions 195
3.17 References and Reference Parameters 196
3.18 Default Arguments 201
3.19 Unary Scope Resolution Operator 202
3.20 Function Overloading 203
3.21 Function Templates 206
3.22 [Optional Case Study] Thinking About Objects: Identifying a Classs
Attributes 208
4.1 Introduction 240
4.2 Arrays 240
4.3 Declaring Arrays 242
4.4 Examples Using Arrays 242
4.5 Passing Arrays to Functions 258
4.6 Sorting Arrays 262
4.7 Case Study: Computing Mean, Median and Mode Using Arrays 264
4.8 Searching Arrays: Linear Search and Binary Search 269
4.9 Multiple-Subscripted Arrays 273
4.10 [Optional Case Study] Thinking About Objects: Identifying the
Operations of a Class 280
