Preface |
|
xv | |
|
Introduction to Computers and Programming |
|
|
1 | (28) |
|
|
1 | (1) |
|
Computer Systems: Hardware and Software |
|
|
2 | (4) |
|
Programs and Programming Languages |
|
|
6 | (6) |
|
What Is a Program Made of? |
|
|
12 | (4) |
|
Input, Processing, and Output |
|
|
16 | (2) |
|
|
18 | (4) |
|
Procedural and Object-Oriented Programming |
|
|
22 | (2) |
|
|
24 | (1) |
|
Review Questions and Exercises |
|
|
25 | (4) |
|
|
29 | (50) |
|
The Parts of a C++ Program |
|
|
29 | (4) |
|
|
33 | (4) |
|
|
37 | (2) |
|
Standard and Prestandard C++ |
|
|
39 | (1) |
|
Variables, Constants, and the Assignment Statement |
|
|
40 | (5) |
|
|
45 | (2) |
|
|
47 | (5) |
|
|
52 | (4) |
|
|
56 | (1) |
|
Floating-Point Data Types |
|
|
57 | (4) |
|
|
61 | (1) |
|
Determining the Size of a Data Type |
|
|
62 | (1) |
|
More on Variable Assignments and Initialization |
|
|
63 | (1) |
|
|
64 | (1) |
|
|
65 | (3) |
|
|
68 | (2) |
|
Focus on Software Engineering: Programming Style |
|
|
70 | (2) |
|
|
72 | (1) |
|
Review Questions and Exercises |
|
|
72 | (7) |
|
Expressions and Interactivity |
|
|
79 | (88) |
|
|
79 | (6) |
|
|
85 | (8) |
|
|
93 | (2) |
|
|
95 | (3) |
|
|
98 | (3) |
|
|
101 | (6) |
|
Multiple and Combined Assignment |
|
|
107 | (4) |
|
|
111 | (10) |
|
Working with Characters and String Objects |
|
|
121 | (7) |
|
|
128 | (5) |
|
More Mathematical Library Functions |
|
|
133 | (5) |
|
|
138 | (8) |
|
Focus on Object-Oriented Programming: Member Functions |
|
|
146 | (1) |
|
Focus on Debugging: Hand Tracing a Program |
|
|
147 | (2) |
|
Green Fields Landscaping Case Study---Part 1 |
|
|
149 | (3) |
|
|
152 | (1) |
|
Review Questions and Exercises |
|
|
152 | (15) |
|
|
167 | (88) |
|
|
167 | (6) |
|
|
173 | (10) |
|
|
183 | (3) |
|
|
186 | (6) |
|
|
192 | (2) |
|
|
194 | (4) |
|
|
198 | (8) |
|
Checking Numeric Ranges with Logical Operators |
|
|
206 | (1) |
|
|
207 | (2) |
|
More About Variable Definitions and Scope |
|
|
209 | (6) |
|
Comparing Characters and Strings |
|
|
215 | (4) |
|
|
219 | (4) |
|
|
223 | (9) |
|
|
232 | (3) |
|
Testing for File Open Errors |
|
|
235 | (1) |
|
Focus on Testing and Debugging: Validating Output Results |
|
|
236 | (3) |
|
Green Fields Landscaping Case Study---Part 2 |
|
|
239 | (4) |
|
|
243 | (1) |
|
Review Questions and Exercises |
|
|
243 | (12) |
|
|
255 | (58) |
|
The Increment and Decrement Operators |
|
|
255 | (5) |
|
Introduction to Loops: The while Loop |
|
|
260 | (4) |
|
|
264 | (2) |
|
Letting the User Control the Loop |
|
|
266 | (2) |
|
|
268 | (1) |
|
|
269 | (2) |
|
Using a Loop to Read Data From a File |
|
|
271 | (3) |
|
The do-while and for Loops |
|
|
274 | (10) |
|
Deciding Which Loop to Use |
|
|
284 | (1) |
|
|
285 | (3) |
|
|
288 | (2) |
|
|
290 | (2) |
|
Focus on Software Engineering: Using Loops for Data Validation |
|
|
292 | (3) |
|
Focus on Testing and Debugging: Creating Good Test Data |
|
|
295 | (3) |
|
Central Mountain Credit Union Case Study |
|
|
298 | (5) |
|
|
303 | (1) |
|
Review Questions and Exercises |
|
|
303 | (10) |
|
|
313 | (78) |
|
|
313 | (1) |
|
Defining and Calling Functions |
|
|
314 | (8) |
|
|
322 | (2) |
|
Sending Data into a Function |
|
|
324 | (4) |
|
|
328 | (4) |
|
|
332 | (2) |
|
Returning a Value from a Function |
|
|
334 | (4) |
|
Returning a Boolean Value |
|
|
338 | (2) |
|
Using Functions in a Menu-Driven Program |
|
|
340 | (3) |
|
Local and Global Variables |
|
|
343 | (6) |
|
|
349 | (4) |
|
|
353 | (4) |
|
Using Reference Variables as Parameters |
|
|
357 | (8) |
|
|
365 | (4) |
|
|
369 | (4) |
|
|
373 | (3) |
|
|
376 | (5) |
|
|
381 | (1) |
|
Review Questions and Exercises |
|
|
381 | (10) |
|
Introduction to Classes and Objects |
|
|
391 | (86) |
|
Combining Data into Structures |
|
|
391 | (3) |
|
Accessing Structure Members |
|
|
394 | (4) |
|
|
398 | (4) |
|
|
402 | (4) |
|
Structures as Function Arguments |
|
|
406 | (4) |
|
Returning a Structure from a Function |
|
|
410 | (3) |
|
|
413 | (4) |
|
|
417 | (2) |
|
Object-Oriented Programming |
|
|
419 | (4) |
|
|
423 | (2) |
|
|
425 | (2) |
|
Defining Member Functions |
|
|
427 | (7) |
|
Focus on Software Engineering: Design Considerations |
|
|
434 | (5) |
|
Using a Constructor with a Class |
|
|
439 | (1) |
|
|
440 | (3) |
|
|
443 | (4) |
|
|
447 | (4) |
|
Using Private Member Functions |
|
|
451 | (3) |
|
Home Software Company OOP Case Study |
|
|
454 | (7) |
|
Focus on Software Engineering: Object-Oriented Analysis |
|
|
461 | (3) |
|
|
464 | (1) |
|
Review Questions and Exercises |
|
|
464 | (13) |
|
|
477 | (90) |
|
Arrays Hold Multiple Values |
|
|
477 | (2) |
|
|
479 | (2) |
|
Inputting and Displaying Array Contents |
|
|
481 | (6) |
|
|
487 | (6) |
|
Processing Array Contents |
|
|
493 | (9) |
|
|
502 | (4) |
|
|
506 | (1) |
|
Arrays as Function Arguments |
|
|
507 | (9) |
|
|
516 | (8) |
|
Arrays with Three or More Dimensions |
|
|
524 | (4) |
|
|
528 | (12) |
|
National Commerce Bank Case Study |
|
|
540 | (3) |
|
|
543 | (4) |
|
|
547 | (8) |
|
|
555 | (1) |
|
Review Questions and Exercises |
|
|
556 | (11) |
|
Searching and Sorting Arrays |
|
|
567 | (40) |
|
Focus on Software Engineering: Introduction to Search Algorithms |
|
|
567 | (7) |
|
Demetris Leadership Center Case Study---Part 1 |
|
|
574 | (7) |
|
Focus on Software Engineering: Introduction to Sorting Algorithms |
|
|
581 | (8) |
|
Demetris Leadership Center Case Study---Part 2 |
|
|
589 | (7) |
|
Sorting and Searching Vectors |
|
|
596 | (5) |
|
|
601 | (1) |
|
Review Questions and Exercises |
|
|
602 | (5) |
|
|
607 | (50) |
|
Getting the Address of a Variable |
|
|
607 | (2) |
|
|
609 | (4) |
|
The Relationship Between Arrays and Pointers |
|
|
613 | (4) |
|
|
617 | (2) |
|
|
619 | (2) |
|
|
621 | (3) |
|
Pointers as Function Parameters |
|
|
624 | (4) |
|
Focus on Software Engineering: Dynamic Memory Allocation |
|
|
628 | (4) |
|
Focus on Software Engineering: Returning Pointers from Functions |
|
|
632 | (3) |
|
Pointers to Structures and Class Objects |
|
|
635 | (6) |
|
Focus on Software Engineering: Selecting Members of Objects |
|
|
641 | (2) |
|
United Cause Relief Agency Case Study |
|
|
643 | (8) |
|
|
651 | (1) |
|
Review Questions and Exercises |
|
|
652 | (5) |
|
More About Classes and Object-Oriented Programming |
|
|
657 | (104) |
|
The this Pointer and Constant Member Functions |
|
|
657 | (5) |
|
|
662 | (7) |
|
|
669 | (6) |
|
|
675 | (2) |
|
|
677 | (8) |
|
|
685 | (36) |
|
Type Conversion Operators |
|
|
721 | (5) |
|
|
726 | (4) |
|
|
730 | (2) |
|
|
732 | (4) |
|
Protected Members and Class Access |
|
|
736 | (6) |
|
Constructors, Destructors, and Inheritance |
|
|
742 | (5) |
|
Overriding Base Class Functions |
|
|
747 | (3) |
|
|
750 | (1) |
|
Review Questions and Exercises |
|
|
750 | (11) |
|
More About Characters, Strings, and the string Class |
|
|
761 | (60) |
|
|
761 | (5) |
|
Library Functions for Working with C-Strings |
|
|
766 | (12) |
|
String/Numeric Conversion Functions |
|
|
778 | (3) |
|
|
781 | (5) |
|
Character Case Conversion |
|
|
786 | (2) |
|
Writing Your Own C-String Handling Functions |
|
|
788 | (6) |
|
More About the C++ string Class |
|
|
794 | (5) |
|
Creating Your Own String Class |
|
|
799 | (12) |
|
Advanced Software Enterprises Case Study |
|
|
811 | (2) |
|
|
813 | (1) |
|
Review Questions and Exercises |
|
|
814 | (7) |
|
Advanced File and I/O Operations |
|
|
821 | (68) |
|
|
821 | (9) |
|
|
830 | (8) |
|
Passing File Stream Objects to Functions |
|
|
838 | (2) |
|
More Detailed Error Testing |
|
|
840 | (4) |
|
Member Functions for Reading and Writing Files |
|
|
844 | (10) |
|
Working with Multiple Files |
|
|
854 | (1) |
|
|
855 | (4) |
|
Creating Records with Structures |
|
|
859 | (4) |
|
|
863 | (7) |
|
Opening a File for Both Input and Output |
|
|
870 | (5) |
|
Online Friendship Connections Case Study: Object Serialization |
|
|
875 | (5) |
|
|
880 | (1) |
|
Review Questions and Exercises |
|
|
881 | (8) |
|
|
889 | (28) |
|
Introduction to Recursion |
|
|
889 | (8) |
|
The Recursive Factorial Function |
|
|
897 | (2) |
|
The Recursive gcd Function |
|
|
899 | (1) |
|
Solving Recursively Defined Problems |
|
|
900 | (2) |
|
A Recursive Binary Search Function |
|
|
902 | (2) |
|
Focus on Problem Solving and Program Design: The QuickSort Algorithm |
|
|
904 | (4) |
|
Focus on Problem Solving: Exhaustive and Enumeration Algorithms |
|
|
908 | (4) |
|
Focus on Software Engineering: Recursion Versus Iteration |
|
|
912 | (1) |
|
|
913 | (1) |
|
Review Questions and Exercises |
|
|
913 | (4) |
|
Polymorphism, Virtual Functions, and Multiple Inheritance |
|
|
917 | (40) |
|
Type Compatibility in Inheritance Hierarchies |
|
|
917 | (4) |
|
Polymorphism and Virtual Member Functions |
|
|
921 | (5) |
|
Abstract Base Classes and Pure Virtual Functions |
|
|
926 | (5) |
|
Multiple and Virtual Inheritance |
|
|
931 | (9) |
|
Focus on Object-Oriented Programming: Composition Versus Inheritance |
|
|
940 | (5) |
|
Secure Encryption Systems, Inc. Case Study |
|
|
945 | (4) |
|
Review Questions and Exercises |
|
|
949 | (8) |
|
Exceptions, Templates, and the Standard Template Library (STL) |
|
|
957 | (52) |
|
|
957 | (12) |
|
|
969 | (9) |
|
|
978 | (6) |
|
Class Templates and Inheritance |
|
|
984 | (4) |
|
Introduction to the Standard Template Library |
|
|
988 | (15) |
|
|
1003 | (1) |
|
Review Questions and Exercises |
|
|
1003 | (6) |
|
|
1009 | (46) |
|
Introduction to the Linked List ADT |
|
|
1009 | (7) |
|
|
1016 | (16) |
|
|
1032 | (5) |
|
Recursive Linked List Operations |
|
|
1037 | (6) |
|
Variations of the Linked List |
|
|
1043 | (1) |
|
|
1044 | (2) |
|
Reliable Software Systems, Inc. Case Study |
|
|
1046 | (3) |
|
|
1049 | (1) |
|
Review Questions and Exercises |
|
|
1050 | (5) |
|
|
1055 | (40) |
|
Introduction to the Stack ADT |
|
|
1055 | (10) |
|
|
1065 | (4) |
|
|
1069 | (2) |
|
Introduction to the Queue ADT |
|
|
1071 | (8) |
|
|
1079 | (3) |
|
The STL deque and queue Containers |
|
|
1082 | (3) |
|
Focus on Problem Solving and Program Design: Eliminating Recursion |
|
|
1085 | (5) |
|
Review Questions and Exercises |
|
|
1090 | (5) |
|
|
1095 | (26) |
|
Definition and Applications of Binary Trees |
|
|
1095 | (4) |
|
Binary Search Tree Operations |
|
|
1099 | (17) |
|
Template Considerations for Binary Search Trees |
|
|
1116 | (1) |
|
|
1116 | (1) |
|
Review Questions and Exercises |
|
|
1116 | (5) |
Appendix A The ASCII Character Set |
|
1121 | (4) |
Appendix B Operator Precedence and Associativity |
|
1125 | (2) |
Index |
|
1127 | |