Part 1 Fundamentals Chapter 1 Introduction to Computer Programming 1.1 History and Hardware Computer Hardware Bits and Bytes Components Exercises 1.1 1.2 Programming Languages Machine Language Assembly Language Low- and High-Level Languages Procedural and Object-Oriented Languages Application and System Software The Development of C Exercises 1.2 1.3 Algorithms Exercises 1.3 1.4 The Software Development Process Phase Ⅰ: Specify the Program's Requirements Phase Ⅱ: Design and Development Phase Ⅲ: Documentation Phase Ⅳ: Maintenance Backup Exercises 1.4 1.5 Case Study: Design and Development Step 1: Analyze the Problem Step 2: Select an Overall Solution Algorithm Step 3: Write the Program Step 4: Test and Correct the Program Exercises 1.5 1.6 Common Programming Errors 1.7 Chapter Summary 1.8 Chapter Appendix: Numerical Storage Codes Chapter 2 Getting Started in C Programming 2.1 Introduction to C Programming Identifiers The main ( ) Function The printf ( ) Function Exercises 2.1 2.2 Programming Style Indentation Comments Exercises 2.2 2.3 Data Types Integer Data Types Floating-Point Data Types Exponential Notation Exercises 2.3 2.4 Arithmetic Operations Displaying Numerical Values Expression Types Integer Division Negation Operator Precedence and Associativity Exercises 2.4 Programming Exercises 2.5 Variables and Declarations Declaration Statements Initialization Exercises 2.5 2.6 Case Study: Temperature Conversion Step 1: Analyze the Problem Step 2: Select a Solution Algorithm Step 3: Write the Program Step 4: Test and Debug the Program Exercises 2.6 2.7 Programming and Compiler Errors Programming Errors Compiler Errors 2.8 Chapter Summary 2.9 Chapter Supplement: Memory Allocation Integer Data Types The sizeof () Operator Addresses Exercises 2.9 Chapter 3 Processing and Interactive Input 3.1 Assignment Implicit Type Conversions Explicit Type Conversions (Casts) Assignment Variations Accumulating Counting Exercises 3.1 3.2 Mathematical Library Functions Exercises 3.2 3.3 Interactive Input Caution: The Phantom Newline Character A First Look at User-Input Validation Exercises 3.3 3.4 Formatted Output Format Modifiers Other Number Bases (Optional) Exercises 3.4 3.5 Symbolic Constants Exercises 3.5 3.6 Case Study: Interactive Input Requirements Specification Exercises 3.6 3.7 Common Programming and Compiler Errors Programming Errors Compiler Errors 3.8 Chapter Summary 3.9 Chapter Supplement: Introduction to Abstraction Built-in and Abstract Data Types Procedural Abstraction Part 2 Flow of Control Chapter 4 Selection 4.1 Relational Expressions Logical Operators Exercises 4.1 4.2 The if and if-else Statements Compound Statements The if-else statement Exercises 4.2 4.3 The if-else Chain Exercises 4.3 4.4 The switch Statement Exercises 4.4 4.5 Case Study: Data Validation Requirements Specification Analyze the Problem Select an Algorithm Write the Program Test and Debug the Program Exercises 4.5 4.6 Common Programming and Compiler Errors Programming Errors Compiler Errors 4.7 Chapter Summary 4.8 Chapter Supplement: Errors, Testing, and Debugging Testing and Debugging Chapter 5 Repetition 5.1 Basic Loop Structures Pretest and Posttest Loops Counter-Controlled and Condition-Controlled Loops Exercises 5.1 5.2 The while Statement Exercises 5.2 5.3 Computing Sums and Averages Using a while Loop Sentinels The break and continue Statements The Nul 1 Statement Exercises 5.3 5.4 The for Statement Computing Sums and Averages Using a for Loop Exercises 5.4 5.5 Case Studies: Loop Programming Techniques Technique 1: Selection within a Loop Technique 2: Input Data Validation Technique 3: Interactive Loop Control Technique 4: Evaluating Equations Exercises 5.5 5.6 Nested Loops Exercises 5.6 5.7 The do-while Statement Exercises 5.7 5.8 Common Programming and Compiler Errors Programming Errors Compiler Errors 5.9 Chapter Summary Chapter 6 Modularity Using Functions: Part Ⅰ 6.1 Function and Parameter Declarations Function Prototypes Calling a Function Function Header Line Placement of Statements Exercises 6.1 6.2 Returning a Value Function Stubs Functions with Empty Parameter Lists Exercises 6.2 6.3 Case Study: Calculating Age Norms Requirements Specification Step h Analyze the Problem Step 2: Select an Overall Solution Algorithm Step 3: Write the Program Step 4: Test and Correct the Program Exercises 6.3 6.4 Standard Library Functions Mathematical Library Functions The rand ( ) and srand ( ) Functions Scaling Coin Toss Simulation Input/Output Library Functions Character Processing Functions Conversion Functions Exercises 6.4 6.5 Common Programming and Compiler Errors Compiler Errors 6.6 Chapter Summary Chapter 7 Modularity Using Functions: Part Ⅱ 7.1 Variable Scope When to Use Global Declarations Misuse of Global Variables Exercises 7.1 7.2 Variable Storage Class Local Variable Storage Classes Global Variable Storage Classes Exercises 7.2 …… Part 3 Completing the Basics Part 4 Additional Topics Appendix A Operator Precedence Table Appendix B ASCII Character Codes Appendix C The Standard C Library Appendix D Input, Output, and Standard Error Redirection Appendix E Floating-Point Number Storage Appendix F Creating a Personal Library Appendix G Solutions to Short Answer Questions