2.2 Programming Fundamentals Flashcards
What are programs?
Sequences of instructions for a computer.
What is a variable ?
A named memory address that holds a value.
What is a global variable ?
Variable that can be accessed and changed throughout the program
What is a local variable ?
variables are confined to a loop or subprogram
What are the three basic programming constructs ?
- Sequence
- Selection
- Iteration
What is a sequence ?
A set of instructions that follow on one from another
What is a selection ?
A decision where the program decides to move on based on the results of an event.
What is an iteration ?
The repetition of a block of statements within a computer program.
What are the two types of iteration ?
- Count-controlled
- Condition-controlled
How does a selection work ?
By testing a condition
What is a count-controlled iteration ?
- repeatedly executes a section of code a fixed number of predetermined times
- for loop
What is a condition-controlled iteration ?
- repeatedly executes a section of code until a condition is met - or no longer met
- while loop
What is nesting ?
Including one programming construct within another.
What are the two types of nesting ?
- Nested selection
- Nested Iteration
What is an operator ?
a character that determine what action is to be performed.