Lecture 4: October 2, 2019

Reading: C text, §4.1–4.5, 4.7–4.8, 5.1–5.8
Due: Homework #1, due October 9, 2019


  1. Greetings and felicitations!
    1. Change of classrooms for 2 discussion sections:
      1. Discussion section A02 (Wed 5:10pm–6:00pm) moved from 223 Olson to 176 Chemistry
      2. Discussion section A03 (Thu 1:10pm–2:00pm) moved from 223 Olson to 204 Art
    2. Homework question 4: vis prints everything as typed, except for non-printing characters and ‘\’; the ones listed in the table are printed as shown, and all others as ‘\ooo
    3. Work on assignments individually. There are not group assignments!
  2. fahr2.c
    1. #include <stdio.h>
    2. Macros
    3. float
    4. for loop
  3. Relations and conditionals
    1. <, <=, >, >=, ==, !=
    2. &&, ||, !
    3. Use in a while loop
  4. Error handling
    1. if statement
    2. Back to program
  5. Usability: prompt for amount
  6. Loops
    1. for loops
    2. while loops
    3. do… while loops
  7. Debugging
    1. Look for where the error might be occurring
    2. Add printfs as needed, breaking up the line if necessary
    3. Example: fahr2-bug.c

UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
ECS 36A, Programming and Problem Solving
Version of October 12, 2019 at 10:43AM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh