I literally studied for the wrong mock so this is very last minute AHHHHHHHH
Advantages of using subroutines
The code doesn’t have to be repeated every time it needs to run
Easier to modify logic, since only the subroutine will need to be edited rather than editing numerous places in the code
Local variables
Are only useable within that part of the code. Eg a local variable in a subroutine cannot be used in the main code
Function
Similar to a subroutine but returns a value, (parameters for that value are in brackets next to function)
arrays
have to contain the same data type
Fixed size (so data cannot be added)
Records
Can have multiple data types
Can have data added to it
Parameter
Is a way of passing a value to a subroutine
Return
In a function this value can be returned, usually something has to be done with it or it is stored in the main code.