|
|
Preface |
xxxiv |
|
1 |
Introduction to Computers and C++ Programming |
1 |
|
1.1 |
Introduction |
2 |
|
1.2 |
What is a Computer? |
4 |
|
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 |
7 |
|
1.7 |
History of C and C++ |
8 |
|
1.8 |
C++ Standard Library |
10 |
|
1.9 |
Java |
11 |
|
1.10 |
Visual Basic, Visual C++ and C# |
11 |
|
1.11 |
Other High-level Languages |
13 |
|
1.12 |
Structured Programming |
13 |
|
1.13 |
The Key Software Trend: Object Technology |
14 |
|
1.14 |
Basics of a Typical C++ Environment |
15 |
|
1.15 |
Hardware Trends |
17 |
|
1.16 |
History of the Internet |
18 |
|
1.17 |
History of the World Wide Web |
19 |
|
1.18 |
World Wide Web Consortium (W3C) |
20 |
|
1.19 |
General Notes About C++ and This Book |
20 |
|
1.20 |
Introduction to C++ Programming |
21 |
|
1.21 |
A Simple Program: Printing a Line of Text |
21 |
|
1.22 |
Another Simple Program: Adding Two Integers |
26 |
|
1.23 |
Memory Concepts |
30 |
|
1.24 |
Arithmetic |
31 |
|
1.25 |
Decision Making: Equality and Relational Operators |
34 |
|
1.26 |
Thinking About Objects: Introduction to Object Technology and the Unified Modeling LanguageT |
40 |
|
1.27 |
Tour of the Book |
44 |
|
2 |
Control
Structures |
70 |
|
2.1 |
Introduction |
71 |
|
2.2 |
Algorithms |
72 |
|
2.3 |
Pseudocode |
72 |
|
2.4 |
Control Structures |
73 |
|
2.5 |
if Selection Structure |
76 |
|
2.6 |
if/else Selection Structure |
77 |
|
2.7 |
while Repetition Structure |
81 |
|
2.8 |
Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition) |
83 |
|
2.9 |
Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 2 (Sentinel-Controlled Repetition) |
86 |
|
2.10 |
Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 3 (Nested Control Structures) |
94 |
|
2.11 |
Assignment Operators |
98 |
|
2.12 |
Increment and Decrement Operators |
99 |
|
2.13 |
Essentials of Counter-Controlled Repetition |
102 |
|
2.14 |
for Repetition Structure |
104 |
|
2.15 |
Examples Using the for Structure |
109 |
|
2.16 |
switch Multiple-Selection Structure |
113 |
|
2.17 |
do/while Repetition Structure |
120 |
|
2.18 |
break and continue Statements |
122 |
|
2.19 |
Logical Operators |
124 |
|
2.20 |
Confusing Equality (==) and Assignment (=) Operators |
127 |
|
2.21 |
Structured-Programming Summary |
128 |
|
2.22 |
[Optional Case Study] Thinking About Objects: Identifying a System's Classes from a Problem Statement |
133 |
|
3 |
Functions |
169 |
|
3.1 |
Introduction |
170 |
|
3.2 |
Program Components in C++ |
170 |
|
3.3 |
Math Library Functions |
171 |
|
3.4 |
Functions |
173 |
|
3.5 |
Function Definitions |
174 |
|
3.6 |
Function Prototypes |
178 |
|
3.7 |
Header Files |
180 |
|
3.8 |
Random Number Generation |
182 |
|
3.9 |
Example: Game of Chance and Introducing enum |
188 |
|
3.10 |
Storage Classes |
192 |
|
3.11 |
Scope Rules |
195 |
|
3.12 |
Recursion |
198 |
|
3.13 |
Example Using Recursion: Fibonacci Series |
202 |
|
3.14 |
Recursion vs. Iteration |
206 |
|
3.15 |
Functions with Empty Parameter Lists |
208 |
|
3.16 |
Inline Functions |
209 |
|
3.17 |
References and Reference Parameters |
211 |
|
3.18 |
Default Arguments |
215 |
|
3.19 |
Unary Scope Resolution Operator |
217 |
|
3.20 |
Function Overloading |
219 |
|
3.21 |
Function Templates |
222 |
|
3.22 |
[Optional Case Study] Thinking About Objects: Identifying a Class's Attributes |
225 |
