programsSequences of instructions for a computer. are designed using common building blocks. These building blocks, known as programming concepts (or programming constructs), form the basis for all programs.
There are three basic building blocks to consider:
sequenceIn computer programming, this is a set of instructions that follow on one from another. is the order in which instructionA single action that can be performed by a computer processor. occur and are processed
selectionA decision within a computer program when the program decides to move on based on the results of an event. determines which path a program takes when it is running
iterationThe repetition of a block of statements within a computer program. is the repeated executionThe process of a program being run on a computer. of a section of code when a program is running
There are two types of iteration:
definite iterationA loop that repeats a set number of times, usually implemented using a FOR loop. (also known as count-controlled iteration)
indefinite iterationA loop that repeats until a condition is either met or no longer met. This is usually implemented using a WHILE or REPEAT UNTIL loop. (also known as condition-controlled iteration)
All programs use one or more of these constructs. The longer and more complex the program, the more these constructs will be used repeatedly.