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

Programming Essentials (Sequence, Iteration and Selection)

This document outlines a Year 7 programming lesson focused on sequencing and selection using Scratch. It includes activities where students give commands to a robot, explore programming concepts, and learn about conditions and expressions in programming. The lesson emphasizes the importance of executing instructions in order and using selection statements to control program flow.

Uploaded by

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

Programming Essentials (Sequence, Iteration and Selection)

This document outlines a Year 7 programming lesson focused on sequencing and selection using Scratch. It includes activities where students give commands to a robot, explore programming concepts, and learn about conditions and expressions in programming. The lesson emphasizes the importance of executing instructions in order and using selection statements to control program flow.

Uploaded by

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

Lesson 1:

Sequencing
Year 7 – Programming essentials in Scratch: part I
Starter activity

Robots vs humans

Question: Can a computer do the job of a musician?

Think, pair, share 2


Activity 1

The robot and the computer programmer

Volunteer needed

Volunteer 1 will play the role of a


human-like robot that can move

The rest of the class will take it in


turns to play a computer
programmer and will give
instructions to the robot
3
Activity 1

Task 1

The computer programmer will


now give the robot a series of
commands

4
Activity 1

Task 1: reflection (think/write/pair/share)

Did the robot successfully


complete the path around the
room?

Was there any confusion?

Why do you think this was?

5
Activity 1

Computers execute commands

When you create a program for a


computer, you give it a set of
commands to execute

It will execute these commands


precisely

Watch this video

6
Activity 1

Task 2

The robot will now be instructed


to complete a different path
around the classroom

This time the computer can only


use the following commands:

● Forward (number of
footsteps)
● Right (degrees)
● Left (degrees)

7
Activity 1

Task 2: Reflection

● Did the robot go through the


door?
● Should they have gone
through the door?
● What was needed to allow
them to go through the door?

8
Activity 2

Computer
programming
Activity 2

“Programming is how you get computers to solve


problems”
There are two key phases that
are important here:

You: Without the programmer


(you), the computer is useless. It
does what you tell it to do.

Solve problems: Computers are


tools. They are complex tools,
admittedly, but they are not
mysterious or magical: they exist
to automate tasks.
1
0
Activity 2

Three key concepts

Over the next set of lessons, you will


look at the three key programming
concepts:

Sequence: Running instructions in


order

Selection: Making choices

Iteration: Doing the same thing


more than once

1
1
Activity 3

Sequencing: Instructions performed in order, with each executed in


turn

As you have seen, computers will


follow your instructions precisely and
in the order in which you tell it.

Can you think of any non-computing


related examples of where
instructions need to be carried out in
the correct sequence?

1
2
Activity 3

Music sequence

Could a computer play music in a sequence?

What extra information would it need to play


this music sequence? 1
3
Activity 3

The sequence

1. Frère Jacques,
2. Frère Jacques,
3. Dormez-vous?
4. Dormez-vous?
5. Sonnez les matines!
6. Sonnez les matines!
7. Ding, dang, dong,
8. Ding, dang, dong,

1
4
Lesson 3:
Selection
Year 7 – Programming essentials in Scratch: part I
This statement is
false
Starter activity

True or false?
Stand in the appropriate area of the classroom

The colour of
this card is
black

1
7
Starter activity

True or false?
Stand in the appropriate area of the classroom

The suit of this


card is hearts

1
8
Starter activity

True or false?
Stand in the appropriate area of the classroom

The value of
this card is
greater than 5

1
9
Starter activity

Conditions and expressions

You evaluated an expression to A selection statement in


‘true’ or ‘false’ and then programming allows a computer
performed an action depending to evaluate an expression to
on the outcome. ‘true’ or ‘false’ and then
perform an action depending on
If “the card is a heart” is true:
the outcome.
Stand next to true

Else:

Stand next to false

2
0
Activity 1

Conditions and expressions: guess who?

If “the character has a hat” is


true:

Remove from game

Else:

Keep in game

2
1
Activity 1

Conditions and expressions: guess who?

2
2
Activity 1

Conditions and expressions: guess who?

2
3
Activity 1

Conditions and expressions: guess who?

2
4
Activity 2

Investigate answers

● Explain what the following


block of code does?

● If the data linked to the


variable ‘health’ evaluates
to ‘true’, then Big Ed will say
“Good, glad to hear it” for 2
seconds

(i.e. if the user has responded


“yes” to the question)
2
5
Activity 2

Investigate answers: If statements

As we have discovered, an If
block allows us to check a
condition and perform an
operation if the condition
evaluates to ‘true’.

If the condition evaluates to


‘false’, the operation will not be
carried out.

2
6
Activity 2

Investigate answers: ‘if/else’ statements

An If block with an Else allows us


to perform a different operation
should the condition evaluate
to ‘false’, before the program
continues.

2
7
Activity 2

Investigate answers

● What is the difference between


the following two blocks of
code?
● If block 1 evaluates as ‘false’,
then it will say “Have a nice
day”

● If block 2 has an Else meaning


that it evaluates as ‘false’,
then it will say “Put your coat
on” before saying “Have a nice 2
8
Activity 2

Investigate answers

● From which menu on the left-


hand side of your Scratch
window would you find the If
blocks?

● Control

2
9
Activity 2

Investigate answers

● From which menu on the left-


hand side of the screen would
you find the following blocks?

● Operators

3
0
Summary

Next lesson

In this lesson, you… Next lesson, you will…

Learned that a condition is an Learn about using logical and


expression that will be comparison operators in selection
evaluated as either ‘true’ or statements
‘false’

Used selection in a program to


control the flow of the sequence

3
1

You might also like