Wednesday, 13 November 2019

Introduction to pseudocode

Pseudocode is a simple language written in plain English and can not be executed or compiled. But explains the algorithm and resolution for a problem.
Actually I pseudocode is not a programming language. But it helps us to define the algorithm through a programming language.
The pseudocode should be rewritten by a programmer using a programming language to execute the code. Pseudocode really gives the idea of the algorithm, we can rewrite it in any language.

If the programmer should rewrite it, why do we need a new language?
Because…
Although it is in simple English, it is easy to understand. It's that much simpler. None programmers also can understand the code. 
I like to list some of the advantages of pseudocode.within programmers also other is language problem, pseudocode helps to have a good understanding of the algorithm. 
Because pseudocode is not itself an actual programming language, it can be used with any language. So it is a language-independent.
And it adds efficiency of the code most of the mistakes were made during planning. So fewer problems will be found during coding.
There are some alternatives to Pseudocode. Some of them are Flowcharts, drakon-charts and Unified Modified Language (UML) charts.

Keywords of pseudocode.
Keywords are the words that can be worked as commands or parameters. Every programming languages have their own keywords. 


START: This is the start of your pseudocode.
INPUT: This is data retrieved from the user through typing or through an input device.
READ / GET: This is input used when reading data from a data file.
PRINT, DISPLAY, SHOW: This will show your output to a screen or the relevant output device.
COMPUTE, CALCULATE, DETERMINE: This is used to calculate the result of an expression.
SET, INIT: To initialize values
INCREMENT, BUMP: To increase the value of a variable
DECREMENT: To reduce the value of a variable
(Source - blog from usejournal.com)

There also some arithmetical and logical keys
  1. + to add
  2. - to minus
  3. x to multiply
  4. / to division
  5. Mod to reminder
  6. And to and gate
  7. Or to or gate
  8. Not to not gate
Comparison keywords 
  1. =  is equal to
  2. ≠  is not equal to
  3. >  Is greater than
  4. < Is smaller than
  5. ≤ is smaller than or equal
  6. ≥ is greater than or equal

Thank you for your attendance, found anything good.. leave it in a comment.
Anything to improve… leave it in a comment…





No comments:

Post a Comment