0% found this document useful (0 votes)
6 views17 pages

Programming Unit6

The document provides definitions for key programming concepts such as 'repeat', 'algorithm', 'loop', and 'nested loop'. It includes examples of conditional actions and how conditions can trigger specific actions in programming. Additionally, it discusses the concept of forever loops that continue until stopped by the user.

Uploaded by

isestudents.ict
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views17 pages

Programming Unit6

The document provides definitions for key programming concepts such as 'repeat', 'algorithm', 'loop', and 'nested loop'. It includes examples of conditional actions and how conditions can trigger specific actions in programming. Additionally, it discusses the concept of forever loops that continue until stopped by the user.

Uploaded by

isestudents.ict
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Write the definition for the term repeat. What is an algorithm?

What is an algorithm? Write the definition for the term loop.

What shape does this code make? Where is the bug in this code?

ALGORITHMS
What we already
know…
Names:_____________

What is a nested loop?

Year 4, Unit 6, Lesson 1, Worksheet 1


© Pearson Education Ltd, 2019. Copying permitted for purchasing institution only. This material is not copyright free. Scratch is used with the kind permission of MIT media labs. Scratch is not affiliated with Pearson Education in any way.
Write the definition for the term What is an algorithm? Write the definition for the term loop.
repeat.
An algorithm is a sequence of Loop: A sequence that starts
Repeat: An action which is instructions to make something from the beginning once it
done more than once. happen. finishes.

What shape does this code make? Where is the bug in this code?
What shape should it create?
ALGORITHMS
A square What we already know
(example)
Names:_____________

What is a nested loop?

Nested loop: A loop within another


loop.
Missing move 50 steps here.
It should make a triangle

Year 4, Unit 6, Lesson 1, Worksheet 2


© Pearson Education Ltd, 2019. Copying permitted for purchasing institution only. This material is not copyright free. Scratch is used with the kind permission of MIT media labs. Scratch is not affiliated with Pearson Education in any way.
Conditional actions

An everyday condition starts action


If it starts to rain, put up your umbrella

If it starts to rain put up your umbrella

condition action

The input starts the output


Year 4, Unit 6, Lesson 1, Worksheet 3
© Pearson Education Ltd, 2019. Copying permitted for purchasing institution only. This material is not copyright free. Scratch is used with the kind permission of MIT media labs. Scratch is not affiliated with Pearson Education in any way.
condition starts action

If partner touches shoulder, tap head


If partner says go, jump for 5 seconds
If partner touches head, clap hop
If partner touches nose, jump clap wait 2 seconds nod
wink

Year 4, Unit 6, Lesson 1, Worksheet 3


© Pearson Education Ltd, 2019. Copying permitted for purchasing institution only. This material is not copyright free. Scratch is used with the kind permission of MIT media labs. Scratch is not affiliated with Pearson Education in any way.
condition starts action
When written in script it will look like this:
If partner touches shoulder touches head
tap head

If partner touches head tap head


clap
hop
clap

Which is the condition? hop


Which is the action?
How does the condition switch between the
action?

Year 4, Unit 6, Lesson 1, Worksheet 3


© Pearson Education Ltd, 2019. Copying permitted for purchasing institution only. This material is not copyright free. Scratch is used with the kind permission of MIT media labs. Scratch is not affiliated with Pearson Education in any way.
Conditional selectional switches

An everyday condition starts action


If it starts to rain, put up your umbrella

If it starts to rain put up your umbrella

condition action

The input starts the output


Year 4, Unit 6, Lesson 3, Worksheet 1
© Pearson Education Ltd, 2019. Copying permitted for purchasing institution only. This material is not copyright free. Scratch is used with the kind permission of MIT media labs. Scratch is not affiliated with Pearson Education in any way.
Condition can switch between the actions

Year 4, Unit 6, Lesson 3, Worksheet 1


© Pearson Education Ltd, 2019. Copying permitted for purchasing institution only. This material is not copyright free. Scratch is used with the kind permission of MIT media labs. Scratch is not affiliated with Pearson Education in any way.
Condition switches between the action
if partner says hello
wave partner stands
else
frown

if partner stands
clap
clap
else
jump

Which is the condition? jump


Which is the action?
How does the condition switch between the
action?

Year 4, Unit 6, Lesson 3, Worksheet 2


© Pearson Education Ltd, 2019. Copying permitted for purchasing institution only. This material is not copyright free. Scratch is used with the kind permission of MIT media labs. Scratch is not affiliated with Pearson Education in any way.
Activity 1
blonde hair black hair

tap head smile

clap nod

Year 4, Unit 6, Lesson 3, Worksheet 2


© Pearson Education Ltd, 2019. Copying permitted for purchasing institution only. This material is not copyright free. Scratch is used with the kind permission of MIT media labs. Scratch is not affiliated with Pearson Education in any way.
Activity 2
blue eyes brown eyes

smile clap

wave hop

Year 4, Unit 6, Lesson 3, Worksheet 2


© Pearson Education Ltd, 2019. Copying permitted for purchasing institution only. This material is not copyright free. Scratch is used with the kind permission of MIT media labs. Scratch is not affiliated with Pearson Education in any way.
Conditional loop examples

Forever loops will carry on until the user stops the program

Heartbeat

Year 4, Unit 6, Lesson 5, Worksheet 1


© Pearson Education Ltd, 2019. Copying permitted for purchasing institution only. This material is not copyright free. Scratch is used with the kind permission of MIT media labs. Scratch is not affiliated with Pearson Education in any way.

You might also like