pseudo-code

3.2.1 h

 * ===describe the steps of an algorithm using pseudo-code;===


 * = KEYWORDS = || = DEFINITION = ||
 * Algorithm || A sequence of steps designed to perform a paticular task ||
 * Pseudo-code || A method of descrbing a program or sytstem and design which uses simliar keywords and phrases found in programming languages but without the strict rules of programs ||

=What is pseudo-code?=

Pseudo-code is, very simply, another method of describing what an algorithm does using plain english instead of using a high level programming code. 'Pseudo' as a prefix usually means 'false', so it can be thought of as a false or a simplified form of normal code. It is used because pseudo-code completely ignores the strict rules of normal programming languages. Saying this, however, it does use some of the keywords (reserved words) and simple layout techniques of some coding languages to clearly show the layout of the algorithm. Common programming features are mixed with simple English in order to describe the individual steps of the given algorithm.

=Are there any 'rules' for writing pseudo-code?= = = By normal definition, there are no 'set in stone' rules for writing pseudo-code, but their are paticular guidelines that will make sure the algorithm is clearly represented:
 * Describe each individual step of the algorithm as breifly as possible.
 * Capitalise keywords that are similar to those used in a high level programming language; for example, 'INPUT', 'IF', 'OUTPUT' etc...
 * Use lower case for words that would not be used in a high level programming language; for example 'IF PIN is wrong for this card'
 * Indenting each section of the code, similar to the way you should in a higher level programming language, helps to keep your pseudo-code readable

=Example:=

If you wanted a program that would automatically print whether a student had passed or failed a test, you can do that very simply with Pseudo-code. For example, imagine a program that would print 'pass' if a student got over 50 marks, and would print 'fail if they got less. To plan this is pseudo-code, it would look like this:

[[image:algorithm.png]]
=Practise exam questions= 1)

2) [] Question 3 e (ii)