Programming Techniques Keywords While, For, Counter, Condition, Boolean, Iteration, Break, Nested iteration, Exit condition, Stepping, Increment/decrement, Larger/Greater, Greater or Equal, Smaller or Equal Programming Techniques Iteration
BEGINNER: Recognise the two common types of iteration. Big Picture Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Computers are good at performing repetitive tasks without human supervision. For example, we can ask a computer to count up to 20,000 (or count down), additionally, we can ask the computer to count while skipping every 2nd or third number and display these numbers doubled on the screen. What repetitive tasks can you name in your life that you wish would just be done automatically by a helper robot? How will the robot know when to stop/task is complete? Starter activity
Looping in a Low Level Language Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
FOR COUNTER (Counter-controlled) Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
BEGINNER: Recognise the two common types of iteration. Exiting FOR Loop Early Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
FOR COUNTER (Counter-controlled) Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
Counter used in calculations Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
Counter used in calculations Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
Loops and Prime Numbers Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Try out this code: Starter activity How does the for loop work in this example?
BEGINNER: Recognise the two common types of iteration. Stepping Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
Backward-flowing Iteration Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
WHILE (Condition-controlled) Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
Conditional Loops for Validation Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
BEGINNER: Recognise the two common types of iteration. While for Searching Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
BEGINNER: Recognise the two common types of iteration. While for Searching Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
BEGINNER: Recognise the two common types of iteration. Test out this code: Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Starter activity
BEGINNER: Recognise the two common types of iteration. Task Objectives BEGINNER: Recognise the two common types of iteration. ADVANCED: Be able to rewrite any FOR loop as a WHILE loop, and some WHILE loops as FOR loops. EXPERT: Understand when to use iteration, including nested iteration, stepping and backward-flowing iteration. Write a program that uses nested iteration to output a 4 x 4 times table. Starter activity