Week 4

Monday

  • Recipe Card Check (attendance)
  • Assignment 1: coming soon!
  • Planning ahead: Thanksgiving
    • class Wednesday before?
  • Lab 2 recap
    • predicate functions
      • functions that produce a boolean value: #true or #false
      • don't use a cond expression; just use boolean expression
    • parameter names should be different from the names of Data Definitions
      • e.g., If NG is the data definition for a number grade, use NG in signatures,
      • but use ng or number-grade or something different from NG for parameter name

Exercise (in class)

Design amount-of-ticket. Given the speed of a car and the speed limit 
of some road, the function determines the penalty a driver has to pay. 
Below is the table printed on the back of such speeding tickets: 
Hint: Create a wish list, because you will need an auxiliary function.


Percentage of Excess Speed Amount ($)
up to 10 50
up to 50 250
up to 100 500
beyond 2000


Structures types: Posns

  • Lecture 6: When Programs Need to Track Two Numbers
    • a first encounter with a struct type, Posns

Wednesday

  • Recipe Card Check


Structure types: Posns

  • Lecture 6: When Programs Need to Track Two Numbers


Structure Types and the Universe of Data

  • Lecture 7: Structure Types and the Universe of Data
    • introduce structure type definitions, explain universe of values

Thursday

  • Lecture (no lab)