A subroutine performs a specific task that is incorporated into then main program to be used. There are 2 types, procedures and functions. Subroutines are not complete programs.
For example:


A subroutine performs a specific task that is incorporated into then main program to be used. There are 2 types, procedures and functions. Subroutines are not complete programs.
For example:


A parameter is a numerical or other measurable factor forming one of a set that defines a system or sets the conditions of its operation.
A parameter passing is the process of providing a procedure, function or module with values at the point when you call it.
By Value is if a data item is passed by value, a (local) copy of the data is used, which is discarded when the subprogram exits.
By Reference is if a data item is passed by reference, the location (in memory) of the data is used. This means that any changes are retained after the procedure or function has been completed.
For example


If statements are used to check if a condition applies, on a false result the program will move onto the next piece of code which could be an elseif statement which is just a continuation of the if statement to test the condition against something else. An else statement applies if non of the conditions before are met.

Iteration is the repetition of a process. There are two types of iteration, For loops and while loops. A for loop is a count controlled loop whereas a while loop is condition controlled.
For loop example of FizzBuzz:

While loop example:

2s compliment is a way of getting negative binary numbers.
Example:
10101011 in sign and magnitude to denary
The MSB is a minus if it is 1 and a positive if it is a zero so the number will be
-128+32+16+2+1= -85 in denary.
Example turn -90 to 2s compliment
To convert denary into 2s compliment you first write out what 90 is in unsigned binary:
01011010
Then you make it to 1s compliment which means flip it
10100101
and then convert that into 2s compliment which means add 1
10100110
CASE statements are when the variable is tested and if the case is true then it is outputted.
For example:

The program uses a sequence to test each answer so if the user inputs 65 as their score the output will be a D grade.
Unsigned binary just means normal binary.
In 8 bit binary this is the numbers you can use. The highest 8 bit number you can get is 255 and anything over is an overflow
128 64 32 16 8 4 2 1
0 1 0 0 1 1 1 0 = 78
To convert binary to denary you write the denary equivalent to each binary number above and the ones with a 1 you add together.
To convert back to binary you go back to front and take each number away that the denary number goes into until it is all gone.
Sequence, one of the three basic logic structures is the order that the program runs the code so that it functions properly. It means that the program will function in a specific order , for example a variable must be defined before it is used or the computer wont recognise it and wont register it.
An integrated development environment (IDE) is software used to test the program that the person is writing to make sure it works. An IDE can include debuggers, diagnostic programs, cross referencers…
Floating point binary have two parts, the mantissa and the exponent which are both written in 2s compliment.
Floating point is useful because we can get more accurate numbers.
Example
Mantissa Exponent
1.000 1100 0100
As the exponent is 4 that means the decimal point moves four spaces to the right from its starting point which is always behind the MSB
10001.100= -16 + 1 + 1/2
= -14.5
To convert denary into floating point, you just do the same method backwards.
Example:
1.75=
-2 1 . 0.5 0.25
0 1 . 1 1
decimal point moves one to left so exponent = 1
Ans= 0111\0001
Decomposition is when programs are broken down into functions and procedures so they are more manageable and can be executed more efficiently.
A version of decomposition is a hierarchal diagram where each sub problem splits off so it is more clear and structured instead of everything being at the same place. It also makes the coding a lot more simpler as the programmer only has to think about one problem at a time. By having each problem separate, teams can be assigned to each one to even out the work load.
