In this post you will learn about Pseudo-code with example. Pseudo-code is not an actual programming language. So it cannot be compiled into an executable program. It uses short terms or simple English language syntax's to write code for programs before it is actually converted into a specific programming language. It is a good idea to write it in a simple way first to ensure you have included everything you need. The best way to set this up is by using pseudo-code.
It is informal language that helps programmers develop algorithms. Pseudocode is a "text-based" detail (algorithmic) design tool.This definitely helps save time during actual programming as conceptual errors have been already corrected. Firstly, program description and functionality is gathered and then pseudocode is used to create statements to achieve the required results for a program. Detailed pseudocode is inspected and verified by the designer’s team or programmers to match design specifications. Catching errors or wrong program flow at the pseudocode stage is beneficial for development as it is less costly than catching them later. Once the pseudocode is accepted by the team, it is rewritten using the vocabulary and syntax of a programming language. The purpose of using pseudocode is an efficient key principle of an algorithm. It is used in planning an algorithm with sketching out the structure of the program before the actual coding takes place.
Example:
If student's grade is greater than or equal to 60
Print "passed"
else
Print "failed"
You do not need a programmer to understand above code. It looks like English version only.
Advantages of pseudocode:
• Pseudocode is understood by the programmers of all types.
• it enables the programmer to concentrate only on the algorithm part of the code development.
• It cannot be compiled into an executable program. Example, Java code : if (i < 10) { i++; } pseudocode :if i is less than 10, increment i by 1.
No comments:
Post a Comment