Code.org Lesson 4 - Functions

Code.org Lesson 4 - Functions
1 / 11
suivant
Slide 1: Diapositive
ComputingLower Secondary (Key Stage 3)

Cette leçon contient 11 diapositives, avec quiz interactifs et diapositives de texte.

time-iconLa durée de la leçon est: 50 min

Éléments de cette leçon

Code.org Lesson 4 - Functions

Slide 1 - Diapositive

In a Code.org sequence puzzle, you're tasked with guiding a character to collect all the gems on the screen. Which block is typically used to make the character move multiple steps in a specific direction?
A
"If" Block
B
"Turn Right" Block
C
"Repeat Until" Block
D
"Sound" Block

Slide 2 - Quiz

In a Code.org sequence puzzle, which block is used to create a condition that, when met, allows the program to execute a specific set of actions?
A
"Forever" Block
B
"Move Forward" Block
C
"Repeat Until" Block
D
"If" Block

Slide 3 - Quiz

In a Code.org sequence puzzle, which block is used to create a loop that repeats a specific set of actions a fixed number of times?
A
"Repeat Until" Block
B
"If" Block
C
"Turn Right" Block
D
"Repeat" Block

Slide 4 - Quiz

In programming, what is the primary purpose of using a nested loop structure?
A
To execute a loop only once
B
To create a loop inside another loop
C
o eliminate the need for loops
D
To perform mathematical calculations

Slide 5 - Quiz

KO - Students will understand the concept of functions / conditionals in programming and apply their knowledge to solve puzzles on Code.org.
All - Students will identify the purpose of functions / conditionals in coding.
Most - Students will design and implement a custom functions / conditionals with parameters.
Some - Students will create and utilise functions / conditionals that call other functions (nested functions).

Slide 6 - Diapositive

What is a Function?

Think of a function as a mini-program inside your main program. It's like a magical box that does a specific job for you.
Why Do We Use Functions?
Easy Breakdown: Functions help break big problems into small, manageable pieces. Imagine you have a big puzzle; functions are like individual puzzle pieces.

Reuse: Once you make a function, you can use it many times. It's like having a magic spell you can use in different parts of your game or puzzle.

No Need to Know Everything: You don't need to know how the magic inside the box works. You only need to know what goes in (like ingredients) and what comes out (like a cake).




Slide 7 - Diapositive

Lesson 9 - The Farmer
Functions

Slide 8 - Diapositive

IF Statement
In this example the conditional (IF statement) is placed in a loop. This code checks whether the bee is at a honeycomb, if it is they make honey.

Slide 9 - Diapositive

Lesson 11 - The Artist 3
Conditionals

Slide 10 - Diapositive

Answer the following in full sentences:
1) What did you learn about coding today in class? What?
2) What was the hardest part about today's lesson? Why?
3) What was the most interesting part in today's lesson? When?

Slide 11 - Question ouverte