Lecture Materials
Planning material for all 32 lectures, organized by week. Each lecture page carries its objectives, concept sequence, examples used, common misconceptions, and the in-class activity.
Week 16 · L01 · What Is a Program? Computers, Algorithms, and the C++ Toolchain
L1: L01 · What Is a Program? Computers, Algorithms, and the C++ Toolchain
L2: L02 · Anatomy of a C++ Program: `main`, Statements, Compilation, and the Three Error Classes
Week 16 · L03 · Variables, Built-in Types, and Initialization (`int`, `double`, `char`, `bool`, `const`)
L3: L03 · Variables, Built-in Types, and Initialization (`int`, `double`, `char`, `bool`, `const`)
L4: L04 · Console I/O with `cin`/`cout`: Streams, Formatting, and Input Validation Basics
Week 16 · L05 · Arithmetic Operators, Precedence, and Integer vs Floating-Point Division
L5: L05 · Arithmetic Operators, Precedence, and Integer vs Floating-Point Division
L6: L06 · Type Conversions, Compound Assignment, and Mixed-Type Expressions
Week 16 · L07 · `if`, `if/else`, and Nested Selection
L7: L07 · `if`, `if/else`, and Nested Selection
L8: L08 · `switch`, Multi-Way Selection, and the Conditional Operator
Week 16 · L09 · `while` and `do-while`: Sentinel and Input-Controlled Loops
L9: L09 · `while` and `do-while`: Sentinel and Input-Controlled Loops
L10: L10 · `for`, Nested Loops, `break`/`continue`, and Loop Patterns
Week 16 · L11 · From Problem to Algorithm: IPO Charts, Decomposition, Pseudocode, Flowcharts
L11: L11 · From Problem to Algorithm: IPO Charts, Decomposition, Pseudocode, Flowcharts
L12: L12 · Desk-Checking, Trace Tables, and Test-Case Design
Week 16 · L13 · Defining and Calling Functions: Parameters, Return Values, `void`
L13: L13 · Defining and Calling Functions: Parameters, Return Values, `void`
L14: L14 · Scope, Lifetime, and Program Decomposition with Functions
Week 16 · L15 · Function Overloading, Default Arguments, and Reference Parameters
L15: L15 · Function Overloading, Default Arguments, and Reference Parameters
L16: L16 · Debugging Methodology and Midterm Review · **MIDTERM EXAM**
Week 16 · L17 · 1-D Arrays: Declaration, Indexing, Bounds, and the Array–Memory Model
L17: L17 · 1-D Arrays: Declaration, Indexing, Bounds, and the Array–Memory Model
L18: L18 · Array Algorithms: Fill, Print, Sum/Average, Min/Max, Count, Linear Search
Week 16 · L19 · 2-D Arrays: Declaration, Row/Column Indexing, Nested Traversal
L19: L19 · 2-D Arrays: Declaration, Row/Column Indexing, Nested Traversal
L20: L20 · 2-D Operations: Row/Column Totals, Matrix Addition, Transpose, Passing to Functions
Week 16 · L21 · Characters and Strings: `char` Processing and the `std::string` Class
L21: L21 · Characters and Strings: `char` Processing and the `std::string` Class
L22: L22 · String Algorithms: Reverse, Palindrome, Counting, Word Processing
Week 16 · L23 · Linear Search vs Binary Search: Correctness and Comparisons
L23: L23 · Linear Search vs Binary Search: Correctness and Comparisons
L24: L24 · Selection Sort and Bubble Sort: Tracing, Swapping, Complexity Intuition
Week 16 · L25 · Pointers: Addresses, `&`, `*`, `nullptr`, and Pointer Arithmetic
L25: L25 · Pointers: Addresses, `&`, `*`, `nullptr`, and Pointer Arithmetic
L26: L26 · References, Pass-by-Value vs Pass-by-Reference, and Arrays as Pointers
Week 16 · L27 · Dynamic Memory: `new`, `delete`, Leaks, Dangling Pointers, `std::vector` as Managed Memory
L27: L27 · Dynamic Memory: `new`, `delete`, Leaks, Dangling Pointers, `std::vector` as Managed Memory
L28: L28 · Structures: `struct` Definition, Members, Nesting, Arrays/Files of Records
Week 16 · L29 · Text Files with `ifstream`/`ofstream`: Reading, Writing, Appending, EOF
L29: L29 · Text Files with `ifstream`/`ofstream`: Reading, Writing, Appending, EOF
L30: L30 · Robust Programs: Stream State, Error Checking, Recovery Strategies
Week 16 · L31 · Classes: Data + Behavior, Constructors, Encapsulation
L31: L31 · Classes: Data + Behavior, Constructors, Encapsulation
L32: L32 · From Structs to Classes, Course Synthesis · **FINAL EXAM**