- Created by: meg.revise
- Created on: 14-01-20 21:46
Algorithm - a set of step by step instructions to solve a problem or complete a task.
Sequence - the spacific order in which instructions are performed in an algorithm.
Selection - the choice of which route to take through an algorithm or computer program.
Iteration - using repetition of a process to create a more efficient solution (loops).
Variables are used to store pieces of data that moght be needed later in the program.
In python ypu use an = sign to assign something to a variable, eg name = Billy.
The computer stores variables in RAM (Random Access Memory).
Pseudocode uses a programming stayle layout but is not an actual programming language, it is half way between English and code.
It is used to plan out or write out algorithms.
Definate iteration: repetition a set number of times. for i in range (3):
Array: a list. names=["Billy","Alex","Emily"]
Boolean flag: a variable that is either true or false guessed = false
Indefinate iteration: repetition forever or until a condition is met while guessed == false:
Selection: Changes the flow of the program if then elif else
Trace tables help you locate the value of a variable at different stages. For example if the pseudocode looked like this:
a = 2 b = 3 x =1
while x ≤ b
output a * x
x = x + 1
Then the table would look like this: x output