Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming Techniques

Similar presentations


Presentation on theme: "Programming Techniques"— Presentation transcript:

1 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

2 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

3 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

4 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

5 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

6 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

7 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

8 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

9 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?

10 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

11 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

12 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

13 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

14 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

15 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

16 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

17 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


Download ppt "Programming Techniques"

Similar presentations


Ads by Google