Agenda

  1. Exercise: Functions
    • Every program you write will eventually contain repeated logic — the same calculation, the same formatting, the same decision — appearing in more than one place.
    • Functions solve this problem. A function gives a block of code a label so that you can run it whenever you need it, from as many places as you like.
    • Please download the playground, try each playground page, while sharing progress and taking notes in your portfolio as you go.
  2. Exercise: Data Type Conversions
    • Programs constantly move data between different types.
      • For example, say that a user types a number into a text field — it arrives as a String, but we want to do a calculation using the numeric equivalent.
    • Type conversion is the process of changing a value from one type to another.
    • Please download this playground, try each playground page, while sharing progress and taking notes in your portfolio.

Things to do before our next class

  • In your portfolio, share your progress with these two playgrounds and take notes as needed.