3.2 Programming Flashcards
1
Q
Data types (pseudo code)
A
- integer (INT)
- real (REAL)
- Boolean (BOOL): 2 values (true/false, yes/no)
- character (CHAR)
- string (STRING)
2
Q
advantages of subroutine
A
- allows code to be reused
- would be easier to test
- code could be changed/updated without affecting overall program
- makes program easier to read/understand
3
Q
Selection equations
A
IF-THEN-ELSE statements
ELSE-IF statements
- nested (IF statement inside another)
4
Q
Iteration examples
A
FOR loops
REPEAT-UNTIL loops
WHILE loops
DO-WHILE loops
5
Q
Types of iteration statements
A
- indefinite = no. of repeats depends on a condition (WHILE, REPEAT-UNTIL)
- definite = repeat exact number of times (FOR)