How To Write Pseudocode
Give proper indentation to show hierarchy and make code understandable.
How to write pseudocode. Pseudocode is not an actual programming language. Pseudocode is a loosely defined way of transmitting the concept of an algorithm from a writer to a reader. Writing good pseudocode 1 use a plain text editor. Writing pseudocode is pretty easy actually. Input indicates a user will be inputting something.
This is an unfinished list of remarks on how to write good pseudocode. Use indentation for block body. It uses short terms or simple english language syntaxes to write code for programs before it is actually converted into a specific programming language. Central is the efficiency of this communication not the interpretability of the code by an automated program e g a. This is represented as a sequence of pseudocode statements.
Start with the statement. Arrange the sequence of tasks and write the pseudocode accordingly. For pseudocode but some of the most widely recognised are. It can be tempting to use a word processor e g microsoft word or a similar program to create a rich text document but pseudocode needs as little formatting as possible to keep it simple. Begun and ended explicity as in given pseudocode examples.
Of a pseudo code which establishes the main goal or the aim. Write only one statement per line. Conditions and loops must be specified well ie. Use capital words for reserved commands or keywords for example if you are writing if else statements then make sure if and else be in capital letters. In a sequential method of writing pseudocode steps are executed one after another top down approach.
There is no strict set of standard notations. Selection includes if then else and case and for next while endwhile comes under repetition. The main goal of a pseudo code is to explain what exactly each line of a program should do hence making the code construction phase easier for the programmer. Convention to write pseudocode. How to write a pseudo code.