A simplified version of high level languages like python. Shows the logic not the correct syntax
Why use pseudocode
Most coders can write pseudocode and it can be transferable to other languages
Trace table
Used to allow programmers to trace the value of variables as each line of code is executed
Linear search
Starting at the beginning of the data set, each item of data is examined until a match is made. Once the item is found, the search ends. The data set does not have to be in order
Binary search
Start by setting the counter to the middle position in the list. If the value at the midpoint is less than the value to be found, the list is divided in half. The lower half of the list is ignored and the search keeps to the upper half of the list. This is repeated until the correct number is found
Bubble sort
Look at the first number in the list. Compare the current number with the next number. Is the next number smaller than the current number? If so, swap the two numbers around. If not, do not swap. Move to the next number. Repeat the steps. This might need more than one iteration
Merge sort
The list is repeatedly divided into two until all the elements are separated individually. Pairs of elements are then compared, placed into order and combined. The process is then repeated until the list is recompiled as a whole
Insertion sort
An insertion sort compares values in turn, starting with the second value in the list. If this value is greater than the value to the left of it, no changes are made. Otherwise this value is repeatedly moved left until it meets a value that is less than it. The sort process then starts again with the next value. This continues until the end of the list is reached
Iteration
There are times when a program needs to repeat certain steps until told otherwise, or until a condition has been met. This process is known as iteration. Iteration is often referred to as looping
Selection
Selection is a programming construct where a section of code is run only if a condition is met. In programming, there are occasions when a decision needs to be made. Selection is the process of making a decision. An example would be an IF or an Else statement
Sequence
Sequence is the order in which programming statements are executed. Programming statements usually run one after another in order
Count controlled loop
A count controlled loop is where you know how many iterations you want for example 10. The loop will end when it reaches 10
Condition controlled loop
A condition controlled loop will end when a condition is met for example when you input the correct password
Variable
A variable is a named memory location that holds a value (in RAM). It can change while the program is running
Constant
A constant enables a value to be assigned a name. Unlike a variable, the value assigned to a constant cannot be changed while the program is running
String manipulation
A string is a variable that holds a sequence of one or more alphanumeric characters. It is usually possible to manipulate a string to provide information or to alter the contents of a string
".upper"
It would change the user input from lowercase to uppercase
Concatenation
Adding 2 data types together
Local variables
Variables inside a subroutine. Can only be used inside the subroutine
Global variables
Variable outside of a subroutine. They can be called anywhere in a program
Array
An array is a data structure that holds similar, related data. An array is like a collection of boxes, each of which is called an element
2D array
A two-dimensional array can hold more than one set of data. This type of array is like a table, with data held in rows and columns
Subroutine
Subroutines perform specific tasks and can be called. When it ends the main program continues
Function vs Procedure
A function returns a value a procedure does not
Benefits of using subroutines
Maintainability. Easier to read/understand. Easier to tests and debug
Parameters
Parameters allow us to pass information or instructions into subroutines. Similar to variables
Arguments
The values passed into parameters are called arguments
Ways to maintain code
Comments
Indentation
Sensible variable names
Select
Selects the field (column)
From
Selects the database
Where
This is a condition (for example >£200)
Record
Data in a database is stored as records. Multiple different data types. Example would be first name, last name, DOB, age
Field
Data about one specific thing for example firstname. This will be appear as a column and only have 1 datatype
Authentication
Authentication is the process of a user confirming that they are who they say they are on a computer system
Types of authentication
Username password
Biometrics (fingerprints)
Final testing
Testing carried out when you have a final product
Iterative testing
Testing carried out multiple times during development
Why iterative testing is superior to final testing