|
Overview of Computers and Programming |
|
|
|
Electronic Computers Then and Now |
|
|
2 | (3) |
|
|
|
5 | (8) |
|
|
|
13 | (8) |
|
The Software Development Method |
|
|
21 | (4) |
|
Applying the Software Development Method |
|
|
25 | (8) |
|
Case Study: Converting Miles to Kilometers |
|
|
25 | (3) |
|
|
|
28 | (5) |
|
|
|
33 | (62) |
|
|
|
34 | (7) |
|
Variable Declarations and Data Types |
|
|
41 | (4) |
|
|
|
45 | (10) |
|
General Form of a C Program |
|
|
55 | (3) |
|
|
|
58 | (14) |
|
Case Study: Evaluating a Collection of Coins |
|
|
67 | (5) |
|
Formatting Numbers in Program Output |
|
|
72 | (4) |
|
Interactive Mode, Batch Mode, and Data Files |
|
|
76 | (4) |
|
Common Programming Errors |
|
|
80 | (15) |
|
|
|
87 | (8) |
|
Top-Down Design with Functions |
|
|
95 | (50) |
|
Building Programs from Existing Information |
|
|
96 | (9) |
|
Case Study: Finding the Area and Circumference of a Circle |
|
|
97 | (3) |
|
Case Study: Computing the Weight of a Batch of Flat Washers |
|
|
100 | (5) |
|
|
|
105 | (7) |
|
Top-Down Design and Structure Charts |
|
|
112 | (2) |
|
Case Study: Drawing Simple Diagrams |
|
|
112 | (2) |
|
Functions without Arguments |
|
|
114 | (11) |
|
Functions with Input Arguments |
|
|
125 | (11) |
|
Common Programming Errors |
|
|
136 | (9) |
|
|
|
136 | (9) |
|
Selection Structures: if and switch Statements |
|
|
145 | (64) |
|
|
|
146 | (1) |
|
|
|
147 | (11) |
|
|
|
158 | (4) |
|
if Statements with Compound Statements |
|
|
162 | (4) |
|
Decision Steps in Algorithms |
|
|
166 | (10) |
|
Case Study: Water Bill Problem |
|
|
166 | (10) |
|
|
|
176 | (3) |
|
Case Study: Water Bill with Conservation Requirements |
|
|
177 | (2) |
|
Nested if Statements and Multiple-Alternative Decisions |
|
|
179 | (11) |
|
|
|
190 | (6) |
|
Common Programming Errors |
|
|
196 | (13) |
|
|
|
197 | (12) |
|
Repetition and Loop Statements |
|
|
209 | (70) |
|
|
|
210 | (2) |
|
Counting Loops and the while Statement |
|
|
212 | (4) |
|
Computing a Sum or a Product in a Loop |
|
|
216 | (6) |
|
|
|
222 | (9) |
|
|
|
231 | (7) |
|
|
|
238 | (7) |
|
|
|
245 | (5) |
|
The do-while Statement and Flag-Controlled Loops |
|
|
250 | (4) |
|
Problem Solving Illustrated |
|
|
254 | (7) |
|
Case Study: Collecting Area for Solar-Heated House |
|
|
254 | (7) |
|
How to Debug and Test Programs |
|
|
261 | (3) |
|
Common Programming Errors |
|
|
264 | (15) |
|
|
|
266 | (13) |
|
|
|
279 | (50) |
|
Functions with Simple Output Parameters |
|
|
280 | (9) |
|
Multiple Calls to a Function with Input/Output Parameters |
|
|
289 | (7) |
|
|
|
296 | (2) |
|
Formal Output Parameters as Actual Arguments |
|
|
298 | (4) |
|
A Program with Multiple Functions |
|
|
302 | (10) |
|
Case Study: Arithmetic with Common Fractions |
|
|
303 | (9) |
|
Debugging and Testing a Program System |
|
|
312 | (3) |
|
Common Programming Errors |
|
|
315 | (14) |
|
|
|
316 | (13) |
|
|
|
329 | (38) |
|
Representation and Conversion of Numeric Types |
|
|
330 | (7) |
|
Representation and Conversion of Type char |
|
|
337 | (3) |
|
|
|
340 | (6) |
|
|
|
346 | (10) |
|
Case Study: Bisection Method for Finding Roots |
|
|
348 | (8) |
|
Common Programming Errors |
|
|
356 | (11) |
|
|
|
357 | (10) |
|
|
|
367 | (66) |
|
Declaring and Referencing Arrays |
|
|
368 | (4) |
|
|
|
372 | (2) |
|
Using for Loops for Sequential Access |
|
|
374 | (6) |
|
Using Array Elements as Function Arguments |
|
|
380 | (3) |
|
|
|
383 | (14) |
|
Searching and Sorting an Array |
|
|
397 | (5) |
|
|
|
402 | (5) |
|
Array Processing Illustrated |
|
|
407 | (9) |
|
Case Study: Analysis of Sales Data |
|
|
408 | (8) |
|
Common Programming Errors |
|
|
416 | (17) |
|
|
|
418 | (15) |
|
|
|
433 | (68) |
|
|
|
434 | (6) |
|
String Library Functions: Assignment and Substrings |
|
|
440 | (9) |
|
Longer Strings: Concatenation and Whole-Line Input |
|
|
449 | (5) |
|
|
|
454 | (3) |
|
|
|
457 | (6) |
|
|
|
463 | (6) |
|
String-to-Number and Number-to-String Conversions |
|
|
469 | (7) |
|
String Processing Illustrated |
|
|
476 | (9) |
|
|
|
476 | (9) |
|
Common Programming Errors |
|
|
485 | (16) |
|
|
|
487 | (14) |
|
|
|
501 | (50) |
|
|
|
502 | (5) |
|
Tracing a Recursive Function |
|
|
507 | (8) |
|
Recursive Mathematical Functions |
|
|
515 | (7) |
|
Recursive Functions with Array and String Parameters |
|
|
522 | (6) |
|
Case Study: Finding Capital Letters in a String |
|
|
522 | (3) |
|
Case Study: Recursive Selection Sort |
|
|
525 | (3) |
|
Problem Solving with Recursion |
|
|
528 | (9) |
|
Case Study: Operations on Sets |
|
|
529 | (8) |
|
A Classic Case Study in Recursion: Towers of Hanoi |
|
|
537 | (6) |
|
Common Programming Errors |
|
|
543 | (8) |
|
|
|
544 | (7) |
|
Structure and Union Types |
|
|
551 | (58) |
|
User-Defined Structure Types |
|
|
552 | (6) |
|
Structure Type Data as Input and Output Parameters |
|
|
558 | (6) |
|
Functions Whose Result Values Are Structured |
|
|
564 | (3) |
|
Problem Solving with Structure Types |
|
|
567 | (10) |
|
Case Study: A User-Defined Type for Complex Numbers |
|
|
568 | (9) |
|
Parallel Arrays and Arrays of Structures |
|
|
577 | (11) |
|
Case Study: Universal Measurement Conversion |
|
|
579 | (9) |
|
|
|
588 | (7) |
|
Common Programming Errors |
|
|
595 | (14) |
|
|
|
595 | (14) |
|
Text and Binary File Processing |
|
|
609 | (40) |
|
Input/Output Files: Review and Further Study |
|
|
610 | (11) |
|
|
|
621 | (7) |
|
|
|
628 | (10) |
|
Case Study: Database Inquiry |
|
|
628 | (10) |
|
Common Programming Errors |
|
|
638 | (11) |
|
|
|
639 | (10) |
|
|
|
649 | (44) |
|
Using Abstraction to Manage Complexity |
|
|
650 | (3) |
|
Personal Libraries: Header Files |
|
|
653 | (5) |
|
Personal Libraries: Implementation Files |
|
|
658 | (3) |
|
|
|
661 | (6) |
|
Modifying Functions for Inclusion in a Library |
|
|
667 | (3) |
|
|
|
670 | (4) |
|
Arguments to Function main |
|
|
674 | (3) |
|
Defining Macros with Parameters |
|
|
677 | (5) |
|
Common Programming Errors |
|
|
682 | (11) |
|
|
|
683 | (10) |
|
|
|
693 | (66) |
|
|
|
694 | (4) |
|
Dynamic Memory Allocation |
|
|
698 | (7) |
|
|
|
705 | (6) |
|
|
|
711 | (6) |
|
Representing a Stack with a Linked List |
|
|
717 | (4) |
|
Representing a Queue with a Linked List |
|
|
721 | (6) |
|
|
|
727 | (12) |
|
Case Study: Maintaining an Ordered List of Integers |
|
|
728 | (11) |
|
|
|
739 | (11) |
|
Common Programming Errors |
|
|
750 | (9) |
|
|
|
750 | (9) |
|
Multiprocessing Using Processes and Threads |
|
|
759 | (52) |
|
|
|
760 | (5) |
|
|
|
765 | (7) |
|
Interprocess Communications and Pipes |
|
|
772 | (8) |
|
|
|
780 | (11) |
|
|
|
791 | (13) |
|
Case Study: The Producer/Consumer Model |
|
|
791 | (13) |
|
Common Programming Errors |
|
|
804 | (7) |
|
|
|
805 | (6) |
|
|
|
811 | (62) |
|
C++ Control Structures, Input/Output, and Functions |
|
|
812 | (7) |
|
C++ Support for Object-Oriented Programming |
|
|
819 | (20) |
|
|
|
834 | (5) |
|
|
|
|
|
|
839 | (2) |
|
B. Ansi C Standard Libraries |
|
|
841 | (18) |
|
|
|
859 | (6) |
|
|
|
865 | (6) |
|
|
|
871 | (2) |
| Answers |
|
873 | (28) |
| Glossary |
|
901 | (6) |
| Index |
|
907 | |