Lecture # | Date | Lecture Quiz | Notes | Recording | Pages | Lab | HW | Keywords |
---|---|---|---|---|---|---|---|---|
WEEK 1 | ||||||||
Introduction, course policies and motivations | ||||||||
Chapter 2: Structure of a C program, Commenting, Identifiers, Data types | WEEK 2 | |||||||
Chapter 2 cont.: Variables, Literal Constants, Symbolic/Defined Constants, Formatted I/O, Width and precision modifiers. | ||||||||
Chapter #2 cont.: Revisiting important concepts: Width & precision modifiers. printf and scanf. syntax & runtime errors. Live coding demonstrates: 1- hello world program. 2- uninitialized variable undefined behavior. 3- printf and scanf in action along with some syntax and run time errors (debugging) | WEEK 3 | |||||||
Chapter #3: Expressions(Operators and operands).Operator precedence.Assignment expressions.Simple & Compound assignments. Prefix and postfix (Undefined vs. Well-defined behavior example). Single and mixed data type expressions. implicit data type conversion. | ||||||||
Chapter 3: Live coding example (Undefined vs. Well-defined behavior examples)
Single and mixed data type expressions. implicit (safe), explicit (type casting), and assignment (unsafe) data type conversions. Rounding, truncation using floor(), type casting to int, truncation in printing using precision modifiers. What changes the value stored in a variable: assignment (simple or compound), scanf() in this variable address and pre/post-fix operators. Selection by calculation with examples: (1) Using factors --> how to always get their values to be 0 and 1 (including trimming all positive numbers to 1) . (2) Using thresholds. |
WEEK 4 | |||||||
Chapter #3 cont.: Selection via calculation. What are the tricks/facts used to get the output calculated from the input? Chapter#4: Purpose of functions. Motivation - why? Factor – smaller is easier. Reuse - by you or others. Remove redundancy. Protect data – using the variable doesn't change its value. Top-Down design. Factoring: Each function does a single task (functionally cohesive). Functions terminology. Call / calling / called / Return. Parameter passing. |
||||||||
Chapter# 4: cont. Types of functions: 1- No parameters - no return value: ex. welcome() , menu_options(). 2- No parameters - with return value: ex. get_input(). 3- With parameters - with return value - Many math.h functions, sin(). 4- With parameters - no return value - printf(), display_results(). | WEEK 5 | |||||||
Chapter 4: cont. Types of functions. 3- With parameters - with return value - Many math.h fx, sin(). 4- With parameters - no return value - printf(), display_results(). What is permitted in main() Function? - only local variable definitions, function calls and limited selection or repetition (to call functions). Parameter passing: 1- Pass by address. |
||||||||
Chapter#4 cont. Parameter passing: 1- Pass by address.2- Pass by address. Pointer operations. Scope. Structure Charts. How to read a structure chart. Bad structure charts examples. | WEEK 6 | |||||||
Chapter #4 cont. Problem-solving method (specify, analyze, design, code, test and debug, refine). Chapter #5: Selection. Logical data. logical operators (NOT, AND, OR). Logical operators truth table. Logical expressions evaluation. Short circuit method with example. |
||||||||
Chapter#5 cont. : Short circuit examples. Relational operators (<, <=, >, >=). Comparative operators (==, !=). Compound statements. Examples illustrating compound statements with short circuit method. | WEEK 7 | |||||||
Chapter 5: Complements: 1- Relational and comparative operators. 2- Logical operators.
Examples on complements. Two-way selection: if-else with examples. Nested selection. Dangling else. Conditional expressions. if else vs. conditional expressions. The advantage of "the single-line expression":
|
Midterm Exam #1 - Date: Wednesday, February 22 *** Time: 8:00pm - 9:00pm *** Location: ELLT Hall of Music | |||||||
Chapter 5: Multiway selection: (1) if / else if / else with examples compared to if if structure. (2) switch construct. | WEEK 8 | |||||||
Chapter #5 cont.: Multiway selection (2) switch construct. Fall through behavior. testing floating points for equality challenges. Switch construct rules. When to use a switch and when not to use a switch. if else vs. conditional expressions vs. switch statements. Chapter #6: Repetition using loops. looping basics and terminology. |
||||||||
Chapter #6: Repetition using loops. looping basics and terminology. Repetition Flow chart example (calc avg, min and max of exam scores). Pretest and post-test loops. How to choose the right construct. Factorial example. Event-controlled vs. Counter-controlled processes. Input validation. Basic syntax of while and do while loops. | WEEK 9 | |||||||
Chapter #6 cont. : Basic syntax of while and do while loops. Revisiting Factorial example to demonstrate while and do while loops. Nesting concept. Nested loops with example (range of factorials example). The infinite loop. The for loop basic syntax. | ||||||||
Chapter 6 cont. : The for loop. Converting while loops to for loops examples. Rearranging digits in a number example. Extract a specific digit from a number. Determine the largest digit in the number( Maximum function). Add the largest digit to correct location. Keep finding the next numbers and when to stop. Counting zeros in a number. Recursion: concepts with examples (Restaurant waiting line example). | SPRING BREAK | |||||||
  No lecture | ||||||||
  No lecture | WEEK 10 | |||||||
Chapter #6 cont.: Recursion example with tracing 4! in memory. When to use Recursion. When to not use Recursion.
Review on repetition construct (while, do-while, for loops and recursion) and when to use each of them.
Chapter #8: Arrays: Meaning, motivation and examples from reality. Problem of students’ scores stored in memory. Lecture Quiz: 3 questions about for loops, and nested for loops explained in details. |
||||||||
Chapter #8 cont.: Declaring and defining an array. What is stored in a newly declared array and how to initialize it properly. Accessing array elements. scanf() in an array element. how to loop over all elements in the array.
Lecture Quiz: 4 questions about nested loops explained in details checking for even and odd numbers, 2 recursion questions. |
WEEK 11 | Midterm Exam #2 - Date: Monday, March 27 *** Time: 8:00pm - 9:30pm *** Location: ELLT Hall of Music | ||||||
Chapter #8 cont.: Accessing array elements. scanf() in an array element. how to loop over all elements in the array. Index range checking. Arrays and Functions: 1- Pass a single element by value. 2- Pass multiple elements by value. 3- Pass one or more elements by address. 4- Pass the whole array (can be done only By address). | ||||||||
Chapter 8 cont.: Objects learned till now (Variables, Array elements, Whole Arrays).
Arrays and Measures of Efficiency with examples. Exchanging values appropriately. Selection Sort: 1- Animated. 2- Solved step by step. How many passes are needed to sort a list of n elements? |
WEEK 12 | |||||||
Chapter 8 cont.: Previous exam sorting algorithm question. (2) Bubble sort: Basic idea about how the algorithm works. Implementation of Bubble sort (Whole array vs. part of the array). (3) Insertion sort with examples. Summary thoughts of sorting algorithms. | ||||||||
Chapters 9 & 10: Pointers and pointer applications. What is a pointer? How to store an address in a pointer? and how to print the address stored in a pointer? Declaration of a pointer. Pointer initialization (Between functions & within the same function). Example on Pointers and Variables addresses. | WEEK 13 | |||||||
Chapters 9 & 10 cont.: Quick revision on pointers: motivation, applications, and how to declare, initialize and update pointers. Arrays and pointers. Pointer arithmetic and arrays: (1) Values stored in the array and (2) The addresses of each single element of the array. How to use this relationship to get a dynamic memory allocation during the runtime (malloc). | ||||||||
176 - 183 |
Chapter 8: Searching: (1) Sequential search: Best and worst case scenarios. Implementation of a sequential search. (2) Binary search: Best and worst case scenarios. Binary search examples: (1) Target is found in the list. (2) Target is not found. Implementation of Binary search. Previous exam questions on Binary search. | WEEK 14 | ||||||
Chapter 8 - Multidimensional Arrays: Declaration and Definition. 1D, 2D, 3D and 4D arrays. 2D arrays example.
Previous final exam' questions. |
||||||||
Revision and more previous exams' questions. | WEEK 15 | |||||||
  No lecture - Lecture is canceled to compensate for evening exams 🎉 | ||||||||
  No lecture - Lecture is canceled to compensate for evening exams 🎉 | Final Exam - Date: Thursday, May 4 *** Time: 8:00am - 10:00am *** Location: ELLT Hall of Music |