Thursday, June 16, 2016

Songwriting with Parameters


  • Read the vocabulary words to the right.
  • Share an example of a function that you used in a recent code.org puzzle.
  • Share an example of a parameter that you used in a recent code.org puzzle.
  • Let's look at the lyrics for this song together.
  • Discuss
    • Why do you suppose genius.com wrote the chorus once in the beginning instead of writing it over and over in each place where it is supposed to be sung?
    • What are other benefits of only writing the chorus once when you sing it many times?
  • Imagine that this song is a computer program. Defining a title (like "chorus") for a little piece of code that you use over and over again is called creating a function. This is helpful to computer scientists for the same reasons that it is helpful to songwriters.
    • It saves time not having to write all the code over and over in the program.
    • If you make a mistake, you only have to change it in one place.
    • The program feels less complicated with the repeating pieces defined just once.
  • Discuss
    • What if the chorus isn't exactly the same each time you repeat it? What would you do?
  • Listen to this song
    • What are the lyrics for the chorus?
    • What are the parameters?
    • What would the program for the song look like?
  • Print and complete this activity.
  • Take a picture of the completed worksheet (page 2 only) and post it to your blog.
    • Include an RJ about this activity.
  • Can you think of any popular songs that have a changing chorus?
  • Continue working on your code.org puzzles.