Presentation is loading. Please wait.

Presentation is loading. Please wait.

Learning Objective: to be able to design programs that use iteration.

Similar presentations


Presentation on theme: "Learning Objective: to be able to design programs that use iteration."— Presentation transcript:

1 Learning Objective: to be able to design programs that use iteration.

2 Right Motor Forward Off
Algorithm Efficiency This algorithm isn’t very efficient as it contains repeated sets of instructions. Start Stop Left Motor Forward On Delay 2 Left Motor Forward Off Right Motor Forward On Right Motor Forward Off

3 Right Motor Forward Off
Iteration Iteration allows us to repeat sets of instructions. This algorithm repeats the same set of instructions forever. Start Left Motor Forward On Delay 2 Left Motor Forward Off Right Motor Forward On Right Motor Forward Off

4 Predict what this program will do:
Activity 1 Here is the program for the algorithm given on the previous slide. Predict what this program will do: Prediction: Now write this program and test it on Bobbot.

5 Activity 2 Complete this design in pseudocode for an algorithm that will make Bobbot go forwards and backwards continually. Start Right Motor Forward On Left Motor Forward On Delay 5

6 Place a screenshot of your code here:
Activity 3 Use the Block Editor to create the program you designed in activity 2 and test it on Bobbot. Place a screenshot of your code here:

7 This instructions inside this FOR loop will be repeated 10 times.
FOR Loops It is also possible to repeat a group of instructions a set number of times. We use a FOR loop to do this. This instructions inside this FOR loop will be repeated 10 times.

8 Place a screenshot of your program here:
Activity 4 Adapt the program you created in activity 3 so that the instructions only repeat 5 times. Place a screenshot of your program here:

9 Place a screenshot of your program here:
Activity 5 Create a program that makes Bobbot move in a zig zag like the pattern shown below: Place a screenshot of your program here:

10 Extension Create a program that makes Bobbot move in a square using a FOR loop. Place a screenshot of your program here:


Download ppt "Learning Objective: to be able to design programs that use iteration."

Similar presentations


Ads by Google