0% found this document useful (0 votes)
33 views

Code.org SessionPlan#7(1 4)

Uploaded by

mzmegastorm
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Code.org SessionPlan#7(1 4)

Uploaded by

mzmegastorm
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Code.

org
LESSON 7:
Loops
Warm - up

Hello, How are you? Do you remember what did we learn in the last class?
Ok Let us revise the concepts, (Explain the terms once again to help the student understand better)
Q- What is a sequence? (Wait for student's reply)
A- Proper Order of giving Commands.
Q- What is an algorithm? (Wait for student's reply)
A- Step by step Process, written in any human language, before writing a program.
Q- What is a Debugging? (Wait for student's reply)
A- Process of removing a bug/ Error from the code.
Q- Why is Bug? (Wait for student's reply)
A- An error in the code is called a bug.
Very Good!! so we have revised everything from the last class. Now let us start with a new topic today
ok?
Today We are going to learn about loops and nested loops.
Remember during previous classes we have seen the pink block which says Repeat on it?
Yes! that is known as loop block.
A loop is used to repeat a particular action again and again.
Let me know if you have any other questions.
Explanation for
students: Loop
1. Take a look at this. BlockVery good now I will show
You remember these you a new block called as a
blocks right? Repeat Block. Do you know
What does this picture the meaning of repeat?
tell the computer to do?

Very Good! What does this block


So what this means is move forward 5
times. It's the same as using 5 forward say? Can you read it? Yes so it says
arrow blocks. REPEAT BLOCK comes how many times we want to repeat.
under LOOP COMMAND. Loop means The arrow beside 5 is a drop down
doing something more than once the
exact same way. By using repeat block in and we can select the number we
the instructions it will make you use less want to repeat the block. Let us
number of blocks and hence a shorter now solve all the puzzles using the
code.
loop.
Bee Puzzles
(Loops)
https://studio.code.org/s/course1/lessons/14/l
evels/1
Bee Puzzles
Solution
Treasurer’s Puzzles

So Now let's do loops with Laurel.


Do know Laurel?.
She is a treasurer who needs to collect the
diamonds.
But she cannot do anything without you. You have
to give commands.
Will you help her collect the Treasure?
Very Good!
We have to help Laurel get some diamonds with the
help of Repeat Block.
Explain to the student how to solve this puzzle
(picture is for teachers reference)

https://studio.code.org/s/coursea-2020/lesson
Link s/9/levels/2
Solution for puzzles
Nested Loops

What are loops?


A- When we repeat the same activity.

Today we will also learn about a concept called Nested Loop.


Nested Loop means loop inside a loop.
I know it may sound complicated but let me explain this to you in a simpler way.
Remember I asked you to clap.
So instead of saying clap again and again, I just said you need to clap 3 times.
The action remained the same but the number of instructions reduced. This is called a
loop!
Nested Loops
Nested Loops
https://studio.code.org/s/coursea-2020/lesson
s/6/levels/7

Explain the student


the difference of
loop and nested
loops with help of
an example that
how w can make
our code less
complicated with
help of nested loop?
Nested Loops
Without Nested Loop With nested loop
Activities For Students

https://studio.code.org/s/course1/lessons/14/l
evels/5
SOLUTION FOR NESTED PUZZLES

Note: Perform this activity when time permits else start


developing the project.
Artist Lab Project

Activity Link: Artist Lab Project


Artist Lab Project

Now, let us meet our new friend, Mr. Artist.

What is the name of your best friend?

Ok, so let us call Mr. Artist by the name of your friend.


Now, we will help Mr. Artist (best friend’s name) to draw something.
(Explain steps from ‘how to login’ to ‘how to save the project’).
Artist Lab Project

You need to follow the following steps:


1. Make sure you are logged in to code.org platform.
(Share the link with students on chat and ask them to click on the link below)

2. Open the shared link,


https://studio.code.org/projects/artist_k1/nngsfjgq2Hy4MJL9CSOIpQq-aqNmNa-
RWxHFSYrMloU/edit

3. Click on ‘remix’ and start drawing.

4. After completion, click on ‘rename’ and assign an appropriate name.

5. Finally, click on ‘save’.


Artist Lab Project

We will do one free following activity using loops in


Artist Lab.
Loop inside Loop is called Nested Loops.
1.Explain directional Blocks (N, S, E, W, NE, SE, NW,
SW).
2.Explain How to change the colour of the frame.
Use 'Set Colour' and 'Set Pattern' block.
Link : Reference completed Project
Wrap - Up

Okay, so here we come to the end of the session. Congratulations! You did very
well in the class today. So did you enjoy the class? So now you understand what
a loop is and what a repeat block is and how important it is to use a repeat
block? Do you want to go back once and see what we have learnt today?? How
about we revise what we studied today?
• What is a Loop?
• What is Repeat Block?
• What is a Nested Repeat Block?
• Advantages of Repeat Block
• Ask if they have any doubts.
VERY GOOD SO WE WILL TRY TO LEARN MORE AND MORE ABOUT CODING IN
THE UPCOMING CLASSES HAVE A GREAT DAY!
HOMEWORK
Here is the text from the image:
Q.1: Repeat Block with artist (1-10):
https://studio.code.org/s/course1/lessons/18/levels/1
Q. 2: Repeat Block with Scrat (1-12):
https://studio.code.org/s/coursea-2020/lessons/8/levels/1
Q.3: Ocean Artist Puzzle (1-14):
https://studio.code.org/s/pre-express-2020/lessons/8/levels/2
Q.4: Artist Lab Project: You have 4 Squares in one row now you need to make 4 lines of
square by using outer loop or Nested loop. Use the repeat block and try to create 4 lines.
Steps:
•Login to code.org.
•Click on the Link:
https://studio.code.org/projects/artist_k1/xscqLRAXuyMJ2u7val3Nu-f9woutqTD4VLQ43ES
_vEQ
•Click on How it Works.
•Click on Remix.
Thank You !

20

You might also like