Component 2 Flashcards Textbook
What is an algorithm?
A series of instructions that solves a problem in a finite number of steps
What three criteria lead to a successful algorithm?
- Accuracy
- Consistency
- Efficiency
What does unambiguous mean?
Written in a way that makes it completely clear what is meant
What are the two ways to plan and design an algorithm?
- Visual (Using flow chart symbols)
- Text (Using a written sequence of instructions)
What is the difference between an algorithm and a problem?
Before you can write a program to solve a problem, you have to work out the algorithm first
What is a variable?
A storage location used to store a value; this could be text or a number. The value stored in the variable may change as the program is run.
What are the rules for a variable name?
- Must be written before a value is assigned to it
- Cannot start with a number
- Must not have spaces
- Must make sense in algorithm
What is ‘=’ in OCR pseudocode?
Assignment of a value to a variable
What is ‘==’ in OCR pseudocode?
Shows equality
What is the flow chart symbol for a terminator and what does it show?
- Oval / Rounded Rectangle
- Start or end of algorithm
What is the flow chart symbol for a process and what does it show?
- Rectangle
- Process in algorithm e.g. Calculating price
What is the flow chart symbol for a decision and what does it show?
- Diamond
- Have one of two answers; yes or no, true or false
What is the flow chart symbol for an input or output and what does it show?
- Parallelogram
- Shows data into algorithm or outputs from it
What does an arrow show in a flow chart?
- Sequence of steps in the algorithm
- Usually vertical or horizontal
What is a flow chart?
Visual representation of the sequence of steps in an algorithm
What is assignment?
Giving a variable or constant a value by linking a value to the identifier
What is an identifier?
A unique name given to a variable or constant in your algorithm which makes your algorithm easier to read and understand
What is pseudocode?
A structured, code-like language that can be used to describe an algorithm
What are keywords?
Used in pseudocode for common operators; written in capital letters
What are some example keywords?
INPUT- Getting values into the algorithm from user via keyboard
OUTPUT- Messages or results displayed on screen
What are the pseudocode arithmetic operators for addition, subtraction, multiplication and division?
+ , - , * , /
What are the pseudocode arithmetic operators for integer division and modulus?
DIV (only evaluates quotient which is the integer)
MOD (only evaluates remainder)
List all the comparison operators (and what they evaluate to)
< - Less than (True)
> - Greater than (False)
== - Same as (True)
!= - Not equal to (True)
<= - Less than or equal to (True True)
>= - Greater than or equal to (True False)
True or False: Arithmetic Operators are evaluated AFTER comparison operators
False, evaluated BEFORE.