Programming Constructs Flashcards
What are the three programming constructs?
- Sequence
- Selection
- Iteration
What is the sequence construct?
Sequence constructs tells the processor which statement is to be executed next, this is usually two or more statements following one after another.
What is an assignment statement?
A value is assigned to a variable
What is the selection statement?
Selection statement are used to select which statement will be executed next, depending on some condition, conditions are formulated using relational operators.
What is a repetition construct?
- Repetition construct causes a group of one or more program statements to be invoked repeatedly until some end condition met
- Iterative statements always involve performing a loop in the program to repeat a number of statements.
What are the two types of iteration?
- Indefinite Iteration
* Definite Iteration
What is indefinite iteration?
Where the iteration continues until some specified condition is met, includes WHILE ENDWHILE REPEAT UNTIL
What is a definite iteration?
Number of times the loop is to be executed is decided in advance.