Programming Concepts

1.0x

Programming Concepts

Created 3 years ago

Duration 0:04:49
lesson view count 73
Select the file type you wish to download
Slide Content
  1. Programming Concepts

    Slide 1 - Programming Concepts

    • Functions, parameters & variables
  2. Functions

    Slide 2 - Functions

    • a function is a built in command that can be used in a code that references a larger chunk of code. Each programming language has it's own functions. We can "call" functions by writing them into our program.
    • Real World Example: a line dance caller may tell dancers to “do-si-do”. Since the dancers already know this dance move, just calling the function “do-si-do” will result in that sequence of moves.
  3. Calling a function in Scratch:

    Slide 3 - Calling a function in Scratch:

  4. Functions with parameters

    Slide 4 - Functions with parameters

    • parameters are details that have to be written with the function in order to tell the function how to run (like time or numbers).
    • Real World Example: a soccer coach may tell her players to run laps by calling: “laps, 5 times”. The players know the function “laps” but require a parameter to tell them how many before they start.
  5. Defining parameters for a function in Scratch:

    Slide 5 - Defining parameters for a function in Scratch:

  6. Variables

    Slide 6 - Variables

    • variables are parameters that can be changed later in the program without recalling the function
    • Real World Example: a music teacher may tell a choir that they are singing Silent Night. When the choir asks for the pace she says, “watch”. The music teacher can then change the pace any time in the song just by conducting at a new pace. She can now change the pace (or “variable”) without stopping the song (or “function) and starting over again.
  7. Using variables in a function in Scratch:

    Slide 7 - Using variables in a function in Scratch: