How To Write Pseudocode
Following are the basic rules before writing pseudocode.
How to write pseudocode. This is represented as a sequence of pseudocode statements. Input indicates a user will be inputting something. How to write a pseudo code. Pseudocode is a loosely defined way of transmitting the concept of an algorithm from a writer to a reader. Write a pseudocode to find the largest of two numbers.
It is possible to write any computer program by using only three basic control structures. Write only one statement per line. Indent when you are enclosing. Selection includes if then else and case and for next while endwhile comes under repetition. Convention to write pseudocode.
So it cannot be compiled into an executable program. Central is the efficiency of this communication not the interpretability of the code by an automated program e g a. Start with the algorithm you are using and phrase it using words that are easily transcribed into computer instructions. For pseudocode but some of the most widely recognised are. Write what you mean not how to program it.
Give proper indentation to show hierarchy and make code understandable. In a sequential method of writing pseudocode steps are executed one after another top down approach. 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. Conditions and loops must be specified well ie. Arrange the sequence of tasks and write the pseudocode accordingly.
Start with the statement. 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. When writing pseudocode we assume that the order of execution of the statements is from top to bottom. Writing pseudocode is pretty easy actually. How to write good pseudocode.