Objectives Define terms command statement control structure sequential


Objectives • Define terms: command, statement, control structure, sequential, and repetition. • Code using simple statements • Identify the purpose of structured programming. • Identify the three control structures used in coding.

Commands are predetermined by the developers of a programming language. Commands are one-word instructions.

Control Structures Control structures help you make sure your code is clear and easy to follow. Using them properly can also save time in writing and executing the code. Three types of basic control structures: • Sequential • Selection • Repetition

Control Structures: Sequential The sequential control structure is the default. In this control structure, the computer follows each line of code in order from top to bottom.

Control Structures: Selection The selection control structure is used for decisions, such as choosing between two or more alternative paths. With this control structure, there are requirements that must be met in order to determine which path will be followed.

Control Structures: Repetition The repetition control structure repeats a piece of code multiple times in a row. This is helpful to reduce the number of lines of code for an action that will need to be repeated many times. The number of times can be set by the programmer, the user, or it could be assigned based on other circumstances within the code.
- Slides: 7