Thursday, 10 November 2016

Pseudo Code


Pseudocode


Most programs are developed using programming languages. These languages have specific syntax that must be used so that the program will run properly. Pseudocode is not a programming language, it is a simple way of describing a set of instructions that does not have to use specific syntax.


Common pseudocode notation

There is no strict set of standard notations for pseudocode, but some of the most widely recognised are:

INPUT – indicates a user will be inputting something

OUTPUT – indicates that an output will appear on the screen
WHILE – a loop (iteration that has a condition at the beginning)
FOR – a counting loop (iteration)
REPEAT – UNTIL – a loop (iteration) that has a condition at the end
IF – THEN – ELSE – a decision (selection) in which a choice is made
any instructions that occur inside a selection or iteration are usually indented

Example

 Set total to zero
Set grade counter to one
While grade counter is less than or equal to ten

    Input the next grade

    Add the grade into the total
Set the class average to the total divided by ten
Print the class average.

No comments:

Post a Comment