Max Rees (they/them)

Lecturer, Department of Computer Science

Purdue University

Fall 2022 — CS 15900

My lectures: view lecture schedule in the table below

My office hours: check Brightspace announcements for cancellations

My office hours for finals week:

TA office hours: check Brightspace announcements for room changes / cancellations

Lecture Quiz Date Artifacts Topic
Week 1
1 NONE Tue
23 Aug
47:25 Overview of the class; course policies; motivations.
Slides
2 NONE Thu
25 Aug
50:16 Chapter 1. Model computer; CPU; types of memory; instruction cycle; natural, machine, and programming languages; programming workflow.
Slides
p. 65 – 74
Assignments posted Lab #0: no point value — complete before Lab #1
Week 2
3 1 Tue
30 Aug
50:45 Chapter 2. C program structure; basic vi and *nix command-line usage; compiler warnings and errors; commenting; C identifiers; data types: int family, including short, long, and long long. Character data type (char) and ASCII table; boolean data type (bool); floating-point data types (float, double, long double); variables: declaration, definition, and initialization; uninitialized variables and undefined behavior.
Slides
p. 75 – 80
4 2 Thu
01 Sep
50:19 Chapter 2 continued. Constants: literal constants, symbolic/defined constants, memory constants; formatted input/output: printf format string and data list; format string placeholders: code, size, precision, (minimum) width, and flag. Variations of the minimum width modifier for printf() placeholders; usage of scanf() for user input.
Slides
p. 80 – 86
Assignments posted Lab #1 (overview)
Homework #1
Week 3
Mon 05 Sep 11:00 PM EDT Homework #1 due
5 3 Tue
06 Sep
50:18 Chapter 2 continued. Types of errors: compile-time errors (including syntax errors and the difference between gcc's "errors" and "warnings"), and run-time errors (including crashes such as segmentation faults and floating point exceptions, and logical errors); debugging with diagnostic printf() statements.

Chapter 3. Expressions; operators; operands; operator precedence; simple and compound assignments; prefix and postfix increment and decrement.
Slides
p. 86 – 91
6 4 Thu
08 Sep
48:57 Chapter 3 continued. Side effects and sequence points; undefined behavior. Single data type and mixed data type expressions; implicit data type conversions (safe) and hierarchy of data types by relative size; explicit data type conversions (can be unsafe) using "type casting" operators; rounding versus truncation with regards to floor(), (int) casts, and printf() precision modifiers; assignment data type conversions (can be unsafe); immutability of object data types; what causes the value of a variable to change (simple or compound assignment operators, scanf(), or prefix/postfix increment/decrement operators).
Slides
p. 91 – 94
30 minutes before lab period Lab #1 due
Assignments posted Lab #2 (overview)
Homework #2
Week 4
7 5 Tue
13 Sep
50:03 Chapter 3 continued. Selection by calculation with examples, including the "scaling to zero or one" formula.

Chapter 4. Purpose of functions; function factoring; functional cohesion; calling function and called function; parameters; return values.
Slides
p. 95 – 98
8 6 Thu
15 Sep
48:44 Chapter 4 continued. Function declarations, calls, and definitions; void functions; functions with no parameters and no return value (static output); functions with no parameters that return a value (input); functions with parameters that return a value (calculation); functions with parameters and no return value (dynamic output).
Slides
p. 99 – 107
30 minutes before lab period Lab #2 due
Assignments posted Lab #3 (overview)
Week 5
Mon 19 Sep 11:00 PM EDT Homework #2 due
9 7 Tue
20 Sep
48:49 Chapter 4 continued. Acceptable main() functions; parameter passing: pass-by-value and pass-by-address; address operator & and dereferencing operator *; pointers and pointer types.
Slides
p. 108 – 111
10 8 Thu
22 Sep
50:55 Chapter 4 continued. Final thoughts on pass-by-address versus pass-by-value: a demonstration and mixing pass-by-address with pass-by-value and return values; swapping the value of two variables; final thoughts on scope (local and global, for variables and functions respectively); flowchart symbols; structure charts: format, rules, good and bad examples; recommended problem-solving method (specify, analyze, design, code, test and debug, refine).
Slides
p. 111 – 115, 73
30 minutes before lab period Lab #3 due
Assignments posted Lab #4 (overview)
Homework #3
Week 6
11 9 Tue
27 Sep
47:32 Overview of the current position in the class's content: just finished sequence with chapter 4; next is selection in chapter 5; then repetition in chapter 6.

Chapter 5. Logical data (true or false); logical expressions; C convention for true and false values ("truthiness"); logical operators: NOT (!), AND (&&), OR (||); truth tables; short-circuiting; simple examples of logical NOT, AND, and OR.
Slides
p. 116 – 118
12 10 Thu
29 Sep
50:25 Chapter 5 continued. Examples of short-circuiting with side effects; relational operators (< <= > >=) and comparative operators (== !=); compound statements; logical complements.
Slides
p. 118 – 121
30 minutes before lab period Lab #4 due
Assignments posted Lab #5 (overview)
Week 7
Mon 03 Oct 11:00 PM EDT Homework #3 due
13 11 Tue
04 Oct
50:29 Chapter 5 continued. Examples of logical complements; two-way selection using the if/else construct; nested selection with if/else; "dangling else" logical error.
Slides
122, 124 – 127
Wed 05 Oct 6:30 – 7:30 PM Midterm #1 — Hall of Music
14 12 Thu
06 Oct
48:55 Chapter 5 continued. Flowchart for the dangling else logical error; two-way selection using the conditional expression (also known as the ternary conditional operator); multi-way selection using if/else if/else.
Slides
p. 127 – 131
30 minutes before lab period Lab #5 due
Assignments posted Lab #6 (overview)
Homework #4
Week 8: NO LAB OR LECTURES THIS WEEK
NONE NONE Tue
11 Oct
NONE Canceled for Fall Break.
NONE NONE Thu
13 Oct
NONE Canceled to account for Midterm #1.
Week 9
Mon 17 Oct 11:00 PM EDT Homework #4 due
15 13 Tue
18 Oct
50:29 Chapter 5 continued. switch construct: case labels and break statements; "fall-through" behavior of switch; comparing floating-point values for equality; C language rules for switch; when and how to use switch.

Chapter 6. Repetition using loops: loop control expression (LCE), loop control variable (LCV), loop initialization and loop update, loop iterations.
Slides
p. 132 – 136
16 14 Thu
20 Oct
48:46 Chapter 6 continued. Pre-test versus post-test looping constructs: the minimum number of iterations and when to use each; tabular strategy for analyzing looping code; event-controlled versus counter-controlled processes; input validation as a event-controlled process using a post-test looping construct; while and do-while loops; implementation of the factorial example.
Slides
p. 136, 139 – 144
30 minutes before lab period Lab #6 due
Assignments posted Lab #7 (overview)
Homework #5
Week 10
17 15 Tue
25 Oct
48:58 Chapter 6 continued. Nested loops and an example using factorials for ranges of numbers; infinite loops and forcing programs to exit using Ctrl-C; introduction to the C for loop and when to use it; examples of rewriting while loops into for loops; looping example with structure chart and flowcharts: calculating average, minimum, and maximum for an unknown amount of exam scores.
Slides
p. 144 – 150, 137 – 138
18 16 Thu
27 Oct
49:35 Chapter 6 continued. Another example with structure chart, flowcharts, and code: rearranging the digits in a number from largest to smallest; introduction to recursion: recursive cases and base cases; example of recursion with factorials.
Slides
p. 151 – 158
30 minutes before lab period Lab #7 due
Assignments posted Lab #8 (overview)
Week 11
Mon 31 Oct 11:00 PM EDT Homework #5 due
19 17 Tue
01 Nov
49:11 Chapter 6 continued. Limitations of recursion (stack overflow); review of repetition techniques.

Chapter 8. Introduction to arrays: motivation, concept, declaration and definition, initialization and assignment; iterating over arrays with loops.
Slides
p. 159 – 164
20 18 Thu
03 Nov
49:56 Chapter 8 continued. Going beyond the limits of an array; arrays across function boundaries: syntax and semantics of passing individual array elements by value and by address, and of passing entire arrays by address; handling of the array name as an address and the index as an offset with respect to that address (hence zero-based indexing).
Slides
p. 164 – 171
30 minutes before lab period Lab #8 due
Assignments posted Lab #9 (overview)
Homework #6
Week 12
21 19 Tue
08 Nov
50:31 Chapter 8 continued. Summary of passing various objects (variables, array elements, and arrays) by value, by address, and using the return keyword; printing or scanning entire arrays; introduction to efficient usage of arrays: more efficiently reversing the order of elements in an array; introduction to sorting: method of swapping values, unsorted lists and sorted lists, and passes.
Slides
p. 171 – 173
22 20 Thu
10 Nov
49:10 Chapter 8 continued. Algorithm for selection sort; algorithm and code for bubble sort; algorithm for insertion sort.
Slides
p. 174 – 178
30 minutes before lab period Lab #9 due
Assignments posted Lab #10 (overview)
Week 13
Mon 14 Nov 11:00 PM EST Homework #6 due
23 21 Tue
15 Nov
50:05 Chapter 8 continued. Solving questions regarding sorting algorithms; comparison and summary of sorting algorithms; introduction to searching: sequential search concept and implementation; introduction to binary search.
Slides
p. 179 – 183
24 22 Thu
17 Nov
46:21 Chapter 8 continued. More sorting questions; binary search: algorithm, examples, and implementation.
Slides
p. 184 – 187
Thu 17 Nov 8:00 – 9:30 PM Midterm #2 — Hall of Music
30 minutes before lab period Lab #10 due
Assignments posted Lab #11 (overview)
Homework #7
Bonus questions key This is the key for the bonus questions from Lecture Quiz #21 and Lecture Quiz #22. Please click the links to work on the question first, then open this PDF to review the answers.
Week 14: NO LAB OR LECTURES THIS WEEK
NONE NONE Tue
22 Nov
NONE Canceled to account for Midterm #2.
NONE NONE Thu
24 Nov
NONE Canceled for Thanksgiving Break.
Assignments posted Lab #12 (overview)
Week 15
25 23 Tue
29 Nov
48:20 Chapters 9 & 10. Generalizing addresses and pointer variables from the pass-by-address technique using the address-of operator & and dereferencing/indirection operator *; pointer declaration/definition, initialization, and modification; memory allocation for dynamically-sized arrays using the stdlib.h function malloc() and the sizeof operator.
Slides
p. 191 – 193, 197
26 24 Thu
01 Dec
51:18 Chapters 9 & 10 continued. Relationship of arrays and pointers; pointer arithmetic and arrays; more thoughts on malloc() and sizeof.
Slides
p. 193 – 198
30 minutes before lab period Lab #11 due
Sun 04 Dec 11:00 PM EST Lab #12 due
Homework #7 due
Quiet period (week 16): NO LAB THIS WEEK
27 25 Tue
06 Dec
50:06 Chapter 8 continued. Multidimensional arrays: concept and motivation, declaration/definition, initialization, usage.

Chapter 11. Treating arrays of characters as "strings": syntax for string literals with double quotes; null terminator as a delimiter.
Slides
p. 188 – 190, 199
28 26 Thu
08 Dec
47:58 Chapter 11 continued. Using printf() to print a string with the %s placeholder; the unsafe use of scanf() with the bare %s placeholder and gets() to retrieve a string input from the user; the safe use of getchar() to retrieve a string input from the user; other string functions: strlen(), strcpy(), strcmp().
Slides
p. 199 – 204
Bonus question key This is the key for the bonus question from Lecture Quiz #26. Please click the link to work on the question first, then open this PDF to review the answer.
Finals week (17): NO LAB OR LECTURES THIS WEEK
Fri 16 Dec 1:00 – 3:00 PM Final Exam — Hall of Music

Last modified on Fri 16 Dec 2022 06:08 PM EST.