Recognize patterns in their code
Use “for” loops to shorten their code
Indent their code properly to make it easy to read
Use arithmetic operators to add, subtract, multiply, and divide values
Nest multiple “for” loops inside each other
Loop: A loop allows you to execute the same code a number of times.
“For” Loop: There are many types of loops, including a “for” loop. This loop has a counter that counts from some number to another number, increasing or decreasing the counter every time it executes the code. In this way, it allows you to execute a set of code a certain predetermined number of times.
Arithmetic Operator: For many computer programs, you will need to perform arithmetic operations on numbers. These are much like the operators you have in math, but there is a specific way you need to format them and there are certain shortcuts, like adding 1 to a variable (x++).
In this lesson, students learn about loops, one of the most useful programming constructs. Loops allow you to repeat lines of code multiple times. Later you’ll learn that you can programmatically decide how long you want to run your “for” loop based on a variable in your code. As students start using loops and conditionals, they need to pay attention to how they are writing their code so that it is easy to read--indentation can help with this.
Why is it important to indent your code?
Why are loops helpful? Would there ever be a time when you couldn’t make something happen without a loop?
Why do you think there are special shortcuts for operations like adding or subtracting 1? Are there any other shortcuts that would be helpful?
UK equivalent grade/class - Year 7 +
Key Stage 3
design, use and evaluate computational abstractions that model the state and behaviour of real-world problems and physical systems
understand several key algorithms that reflect computational thinking (for example, ones for sorting and searching); use logical reasoning to compare the utility of alternative algorithms for the same problem
use two or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures(for example, lists, tables or arrays); design and develop modular programs that use procedures or functions
understand simple Boolean logic(for example, AND, OR and NOT) and some of its uses in circuits and programming; understand how numbers can be represented in binary, and be able to carry out simple operations on binary numbers(for example, binary addition, and conversion between binary and decimal)
understand how instructions are stored and executed within a computer system; understand how data of various types (including text, sounds and pictures) can be represented and manipulated digitally, in the form of binary digits
Key Stage 4
develop their capability, creativity and knowledge in computer science, digital media and information technology