Term 1/2 Flashcards
Sequence
Instructions that are carried out one after another in order.
Iteration
Repeating instructions over and over again, this is called a loop.
Selection
A desicion or question. Depending on the answer given (choice), the program will follow a certain step ( path) and ignore the others.
Operators and their meanings:
==
!=
>
<
>=
<=
== - Equal to
!= Not equal to
> More than
< Less than
>= More than or equal to
<= Less than or equal to
Integer
A whole number
String
A set of alphanumeric characters and symbols - eg a word or sequence
Real/ FLoat
Real / Float - Used to store decimal numbers. Typically a number is represented aproximately to a fixed number of signigicant figures and scaled using exponent.
Boolean
Used to store logical conditiond eg TURE/FALSE, ON/OFF, YES/NO
Variable
A value that is stored and can be changed
Constant
A value that is stored and cant be changed
Syntax error
Where your code doesn’t run and you have broken the rules of the language
Logic error
WHere your program runs but does something unexpected
Decomposition
Taking a complex problem and breaking it into a series of smaller more manegable problems.
Abstraction
Removing unecessary details and instead focus on the important factors, ignoring irrelevant information.
Algorithmic thinkking
Step by step instructions to solve a problem ( an algorithm)
Flow chart symbols:
Oval
Parallelogram
Rectangle
Diamond
Oval - STart / end
Parallelogram - Input/ Output
Rectange - Process ( Action, calculation, storing a variable)
Diamond - Decision
Psuedocode
ALlows the designer to focus on the logic of the algorithm without being distracted by the syntax of the programming language.
Linear/ Serial search
Works by checking every single item in the list in order until you find the searched item, or fail to find it at all.
Binary search
A binary seach algorithm can only be used on sorted data
It takes the data and keeps divifing it in half until it finds the item it is looking for.
Bubble sort
Each item in a list is compared to the one next to it and if it is greater, they swap places. This is repeated until the items are sorted
Merge sort
The first stage of a merge sort is to keep splitting the lists in half until they are only 1 item long.
THen each list is first sorted and then recombined to form a fully sorted list.
Insersion sort
INsertion sorts compare values in turn, starting with the second value in the list.
If this value is less than the value to the left of it, they swap places.
Keep moving the value to the left until it doesnt swap.