Lesson 18: Getting classy

Outline:

  1. Questions?
  2. Recap Lesson 17: Defining our own objects
    • example: MultiSidedDie
    • self and instance variables
    • __str__ method
  3. Example: Map class
    • motivation
    • test-driven development—test test test
    • supporting a single pair
    • extending to multiple pairs

Explore after class:

  1. Map class: could you simplify your implementation? Maybe consider a Pair class that you use…

What’s next

Upcoming events/assessments:

  • No CS Bits and Bytes this week
  • Homework assignment 6 is all about nested loops and image processing and is due Thursday

What you should do now:

Reading assignment (to be completed by the next class):

  • Zelle sections 12.2–12.5 (pp. 364–390)