DAY 9 - Coding and Computer Science for Kids 1
Category: Coding & Computer Science 1
Date: June 21, 2018
Description:
 
Coding and Computer Science for Kids 1 - DAY 9
 
♦Please take this survey first today to tell us your last day of Summer School 2018. (Take this survey only one time!)
 

♦LEARNING POST-ASSESSMENTS:

On your last day (or before), using no notes:

1) Take the Computer Science POST-TEST.

2) Take the Coding POST-TEST.

 
 

♦CODING & COMPUTER SCIENCE VOCAB CHECK-UP:
 
♦OPTIONAL: Play Quizlet Live with our class.
 
1) Take the Matching QUIZLET Coding Test and submit current score in Edmodo.
 
 
2) Take the Matching QUIZLET Computer Science Test and submit current score in Edmodo.
 
 
♦Based on your current score, STUDY Coding and Computer Science vocabulary terms in Quizlet to prepare for two class FINAL ASSESSMENTS.
 

 

Code.org SONG-WRITING (Functions):

Lesson Overview:

 

Students learn how to define and call functions using the chorus of song lyrics. Once students are familiar with the define/call process, we will add the extra capabilities that come along with passing parameters within those function calls.

 

 
 
Essential Question:

What are functions, and how do we define and call them as the chorus when singing songs?

 
 

• I can learn about defining functions.

• I can practice calling functions.

• I can see the practicality of passing variables as parameters.

 
 
 

Chorus — (n.) A piece of music that repeats often.

Function — (n.) A piece of code that can be called over and over.

Function Call — (n.) The piece of a program that sends the computer to a function.

Function Definition — (n.) The piece of a program that tells the computer what to do when the code calls a function.

Parameters — (n.) Extra information that you can give to a function to customize it

Recursive — (n.) A definition that refers to the word it is trying to define.

Variable – (n.) A placeholder for a value that can change.

 


 

 
 
 
REVIEW:

Think back to our last conditionals card game lesson.

Class Participation Questions:

• What did we do in our last lesson?

• What is a function?

• What does it mean to call a function?

• What is a counter block?

 

Partner Discussion:

• In many languages, “counter blocks” are called “for loops.” They’re called that because you do *something* FOR all values of the counter from the minimum to the maximum.

• Pretend you have a counter block that keeps track of your age. From age 5 to age 10, you grow two inches a year. From age 11 to age 17, you grow an inch every two years. This requires two blocks. What is the minimum value, maximum value, and add-on amount for each block?

 

Lesson Steps:

Today we will be singing children’s songs, and in the process, learn about how to call and define functions.

 

INTRODUCE:

This lesson works best if we just leap right in. Let’s sing the lyrics of "Oh, Dear! What Can the Matter Be?" together below:

 

CHORUS:

Oh, dear! What can the matter be?

Dear, dear! What can the matter be?

Oh, dear! What can the matter be?

Johnny’s so long at the fair.

 

SONG:

 

Chorus

He promised to buy me a trinket to please me,

And then for a smile, oh, he vowed he would tease me,

He promised to buy me a bunch of blue ribbons

To tie up my bonnie brown hair.

 

Chorus

He promised to bring me a basket of posies,

A garland of lilies, a gift of red roses,

A little straw hat to set off the blue ribbons

That tie up my bonnie brown hair.

 

Chorus

 

“Great job! Give yourself a round of applause.”

 

“Oddly, none of you (or very few of you) sang the actual word ‘CHORUS’. You didn’t say, ‘CHORUS. He promised to buy me a trinket...’ Why is that?”

 

We may not exactly know why we sang the way we sang. Some may know the song, others may have figured out the technique. This is a great time to point out the terminology of “function definition” and “function call.”

 

A Function Call is the piece of a program that sends the computer to a function. In this case, the word Chorus is a function call.

 

A Function Definition is the piece of a program that tells the computer what to do when the code calls a function. In this case, the function definition is the CHORUS identified as “Oh, dear! What can the matter be? / Dear, dear! What can the matter be? / Oh, dear! What can the matter be? / Johnny’s so long at the fair” at the beginning of the song.

 

The second part of this lesson is introducing a song where the chorus lyrics change slightly for each round.

 

Let’s sing these original verses together:

 

CHORUS (sound):

With a sound sound here

And a sound sound there

Here a sound, there a sound

Everywhere a sound sound

Old MacDonald had a farm E-I-E-I-O

 

SONG:

Old MACDONALD had a farm E-I-E-I-O

And on his farm, he had a cow E-I-E-I-O

CHORUS (“Moo”)

 

Old MACDONALD had a farm E-I-E-I-O

And on his farm, he had a pig E-I-E-I-O

CHORUS (“Oink”)

 

Old MACDONALD had a farm E-I-E-I-O

And on his farm he had a duck E-I-E-I-O

CHORUS (“Quack”)

 

Now let’s add-on to the song with lyrics about other animals.

 

What would you put in the chorus parentheses for a dog? A cat?

 

Hopefully you will intuitively know what happens with the sounds that you provide, but if you aren’t yet making a connection between passing a word in through the parentheses and calling that word inside the definition of the chorus, use one finger to indicate which sound you are using, and another to trace where you are in the chorus.

 

You may not have realized it yet, but you have just learned how to pass a parameter to a function! This is exactly how programmers share bits of information with functions that they have written.

 

You can pass certain values into a function, so that the function can use the information with the code inside. The function will just replace the reserved word (which, in our song, is created in the form of the variable sound) with whatever word you gave it inside the parentheses.

 

Let’s test that newfound knowledge with a completely made-up song:

 

CHORUS (thing, place, did):

‘Cause I stuck a thing in a hole in the place and it did, and did, and did.

 

SONG:

 

I’m going to be the most famous kid, because of the thing that I just did.

CHORUS (“seed”, “ground”, “grew”)

 

I’m going to be the most famous kid, because of the thing that I just did.

 

CHORUS (“plug”, “boat”, “floats”)

 

I’m going to be the most famous kid, because of the thing that I just did.

CHORUS (“head”, “sky”, “flies”)

 

This made-up song here give us our class an opportunity to figure out what happens when we pass more than one parameter to a function.

 

After we sing through the song and understand which variable goes where, we will break into small groups and work together to figure out how to rewrite other children’s songs:

 

1) "Five Little Monkeys" – (Most Simple)

2) "Farmer in the Dell" – (Tougher)

3) "Hickory Dickory Dock" – (More Complicated)

 

Additional Student Requested Songs with CHORUS Lyrics:

"Monsters (AKA Haters)" - Mackenzie Ziegler

"Fly Like an Eagle" - Steve Miller Band

 

After you have had a while to work, we will come back together to share our results.

  • How many people rewrote their songs the same way?
  • How many had different solutions?

 


♦Check your Accelerated Intro to CS Course Progress so far in your Code.org account:

 
 
The circles will turn green when they are completed correctly.
 
 
 

 

 

The Farmer 2 Code.org Activity

 

♦Use the blocks to help the farmer remove all the piles and fill in all the holes on the ground. Hint: You can put a loop inside another loop. Use all the same blocks arranged in categories: Actions: Move Forward, Turn, Remove, Fill; Logic: If there is a pile, hole, path ahead; and Loops: While path ahead, Repeat; and Math: change value.
 

Additional Learning Tasks:

 
1) Log in to Edmodo and check notifications for our Coding and Computer Science group. Check your Profile for Edmodo badges earned so far.
 
2) Log in to your Code.org account and work in your Accelerated Intro to CS Course activities.
 
 
3) Explore and study vocabulary words and definitions using the following Quizlet sets:
(Optional: Join our Coding and Computer Science class by clicking here.)
 
(Study Flashcards and play Match game.)
[We will also play Quizlet Live at school.]
 
(Study Flashcards and play Match game.)
[We will also play Quizlet Live at school.]
 
 
4) Check out additional coding apps and resources using your own devices at home.
 

 
 
  Curriculum Attribution: All Accelerated Intro to CS Course lessons are adapted directly from Code.org, an exemplary non-profit organization committed to educating and empowering students, teachers, and parents with essential coding and computer science technology skills.
<print>            <close window>