Please enable JavaScript.
Coggle requires JavaScript to display documents.
Algorithms and Programs (Explain data compression and how data compression…
Algorithms and Programs
Explain the term algorithm and describe common methods of defining algorithms, including pseudocode, flowcharts and structured English.
Defining algorithms
An algorithm is a sequence of steps designed to perform a particular task. They can be designed using structured English, pesuedocode and flowcharts.
-
-
Identify, explain and use counts and rogue values
-
Rogue: a value which tells the computer that input has finished. If a program accepts positive integers, then -1 might be the rogue value to indicate the end of the list. It is not a meaningful value.
Identify, explain and use logical operators (AND OR NOT & XOR)
-
-
-
-
Identify, explain and use mathematical operations (including DIV and MOD)
DIV - means how many times it goes into a number. For example, 5 DIV 2 is equal to 2 as that is how many times 2 goes into 5.
MOD - it is a division but it only provides the remainder. For example, 5 MOD 2 is equal to 1 as 2 goes into 5 twice with 1 remaining.
Identify, explain and use sequence, selection and repetition
Sequence - steps are processed one by one, no complications.
-
-
Identify and explain self-documenting identifiers, annotation and program layout
Identifier (self-documenting) - a name given to an element of a program so it can be referred to throughout.
-
-
-
-
You need to make programs more readable for other programmers, this can be done by:
-
-
Meaningful names (self-documenting identifiers) - makes it clear what the variable contains and aids readability.
-
Identify and explain the nature, use and possible benefits of standard functions, standard modules and user defined subprograms
-
-
Standard Function
Carries out a common task for a standard situation in a program, and is provided by the compiler.
-
-
Explain the purpose and effect of procedure calling, parameter passing and return, value parameters and reference parameters.
-
-
-
Reference parameters
The memory address of the data is passed to the procedure, therefore the original data in the calling environment can be altered.