Unit 1 Fundamentals of Programming Flashcards
What is an algorithm?
A sequence of steps that can be followed to complete a task
What is abstraction?
Abstraction involves removing unnecessary detail from a problem so that you can focus on the essentials.
What is decomposition?
Breaking a problem down into smaller sub-problems, making the overall problem easier to solve
Advantages of decomposition
- The problem becomes easier to solve when it consists of a number of smaller subtasks or modules
- Some modules may be reusable in other programs, saving development time
Processing
Any operations carried out by a computer system
What is a variable?
A variable is a location in memory in which you can temporarily store text or numbers
Data types
- Integer
- Real
- Boolean
- Character
- String
Integer
A whole number
Real
A number with a decimal point
Boolean
Can only be TRUE or FALSE
String
One or more characters enclosed in quote marks
Sequence
The statements are executed in the order they are written
Selection
- An IF statement is a selection statement
- The next statement to be executed depends on whether the condition being tested is true or false
Iteration
- Iteration means repetition
- A set of statements are repeated a fixed number of times, or until a condition is met
Three types of iteration statements
- FOR…ENDFOR
- WHILE…ENDWHILE
- REPEAT…UNTIL