The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.
How can we store data in a program to solve problems?
What might happen if you completed the steps in your regular morning routine to get ready and go to school in a different order? How might the reordering affect the decisions you make each morning?
How do video games group different actions for a player based on what key is pressed on the keyboard or controller? How do apps group different actions together based on user interaction, such as pressing buttons?
What types of problems can be solved more easily with a computer, and what types can be solved more easily without a computer? Why?
Express an algorithm that uses iteration without using a programming language.
Write iteration statements.
Determine the result or side-effect of iteration statements.
Iteration is a repeating portion of an algorithm. Iteration repeats a specified number of times or until a given condition is met.
Iteration statements change the sequential flow of control by repeating a set of statements zero or more times, until a stopping condition is met.