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

Slides:



Advertisements
Similar presentations
Love Lifted Me Click here to play The slides advance automatically with the words.
Advertisements

Programming Methodology (1). Iteration Learning objectives explain the term iteration; repeat a section of code with a for loop; repeat a section of.
Iteration and Recursion Tonga Institute of Higher Education.
Programming Concept #2 Iteration. Is just a fancy way of saying that you would like something to repeat more than one time. It is used in any modern programming.
Robot Programming. Programming Behaviors Behaviors describe the actions and decisions of your robot.
Chapter 2 The Algorithmic Foundations of Computer Science
©2006 CSUC Institute for Research in Intelligent Systems Introduction to Coding June 15, 2006.
Copyright © 2014 Dr. James D. Palmer; This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Jennifer Goodall, Nick Webb, Katy DeCorah
Problem Solving Through Coding Names. PROBLEM SOLVING PROCESS UNDERSTAND THE PROBLEM: READ OR LISTEN TO THE PROBLEM. MAKE A PLAN TO SOVLE THE PROBLEM-
Loops and Switches. 1. What kind of blocks are these? 2. Name two kinds of controls that can be specified to determine how long a loop repeats. 3. Give.
Flowol subroutines Subroutines are used to:  Simplify your code to make it easier to read (or for someone.
Robot Programming. Programming Behaviors Behaviors describe the actions and decisions of your robot.
Using MIT Scratch for Programming and Control Exercise 1 Creating movement Year 11 DTG 2012.
Invitation to Computer Science 5 th Edition Chapter 2 The Algorithmic Foundations of Computer Science.
Topic: Control Statements. Recap of Sequence Control Structure Write a program that accepts the basic salary and allowance amount for an employee and.
Algorithms and Pseudocode
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Casne.ncl.ac.uk Taking care of the CrumbleBot Please do NOT stress the robot's motors 1.Do NOT push the robot 2.Do NOT hold the.
An Introduction to Programming Using Alice 2.2, Second Edition Chapter 7 Recursive Algorithms.
26/06/ Iteration Loops For … To … Next. 226/06/2016 Learning Objectives Define a program loop. State when a loop will end. State when the For.
Using Logo to explore spiral patterns. Paul Broadbent Spiral patterns This is a (1,2,3) spiral path. It repeats lines of three.
Scratch Programming Cards
Sequencing Learning Objective: to be able to design algorithms that use sequencing.
Basic Steps in Programming
Data Structures.
Broadcasting (Adding a new level)
Add and Subtract Negative Numbers
Selection Learning Objective: to be able to design algorithms that use selection.
Do it now activity Last lesson we used Flowol to create a solution to a problem a computer could solve. Identify what each symbol does:
Scratch: iteration / repetition / loops
Learning Objective: to be able to design programs that use sequencing.
Diamond Hunt Mock Programming Project.
Module 1: Investigation 3 Creating Circular Rose Patterns
Algorithm Efficiency Algorithm efficiency
Gaming with conditionals
Loops and Switches Pre-Quiz
Learning Outcomes Understand While Loop
LESSON 11 – WHILE LOOPS UNIT 5 – 1/10/17.
Algorithms and Flow Charts
Graph Paper Programming
Raspberry Pi: External Inputs & Outputs
Learning to Program in Python
Learning to Program in Python
Sequencing Learning Objective: to be able to design algorithms that use sequencing.
BBC Microbit.
Graph Paper Programming
Welcome to <INSERT school name>’s
Lesson 4 Accelerometer.
Selection Learning Objective: to be able to design algorithms that use selection.
Line Following Behavior
Recap the basics Lesson 1.
Lesson 3.2 Review: Identifying concepts
Moving Sprites in Scratch
Repeating Behaviors.
Line Following Behavior
3.1 Iteration Loops For … To … Next 18/01/2019.
Learning to Program in Python
Iteration Learning Objective: to be able to design algorithms that use iteration.
Welcome to Mountain View Elementary School!
Motion PowerPoint By Mr. Krall 2011.
Code to Enhance Learning
Recap the basics Lesson 1.
Loops and Switches How Do You Make Loops and Switches? lesson > TeachEngineering.org Center for Computational Neurobiology, University of Missouri.
Building Complex Behaviors: Actions and States
Obstacle Detection.
Moving Sprites at Random
Iteration Learning Objective: to be able to design algorithms that use iteration.
Scratch 7B IT 1.
Session 2 Moving and Turning…
Presentation transcript:

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

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

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

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.

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

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:

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.

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:

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:

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