What is Pseudocode: Definition, Examples, Functions, and Structures

what is pseudocode definition examples functions and structures.

What is Pseudocode: Definition, Examples, Functions, and Structures


What is Pseudocode


Are you having trouble learning programming? Understand code by learning Pseudocode. But what is Pseudocode and does it really help?


When you first start learning to program, there's a lot to learn before you build your first application. Thinking like a programmer helps you break down problems into algorithms to solve them. Algorithms are the steps your code takes to solve a problem or answer. question.


It can be a challenge if you are a new coder to think like a programmer from the start. Translating application ideas to actual code takes some practice.


To bridge the gap between what your app wants to do and the code you need to write, you can use pseudocode.


Also Read: Differences in High-Level and Low-Level Programming Languages

TABLE OF CONTENTS

1. Understanding Pseudocode

2. Pseudocode Function

3. Features of Pseudocode

4. Pseudocode Structure

5. Important Points in Writing Pseudocode

6. Advantages and Disadvantages of Pseudocode

7. Advantages of Pseudocode

8. Disadvantages of Pseudocode

9. Pseudocode Example

10. Pseudocode Example Entering Favorite Color

11. Pseudocode Example Calculating the Circumference of a Circle

12. Example of Pseudocode Addition of Two Numbers

13. Example of Modulus Program Pseudocode

14. Pseudocode Example Printing Numbers 1 To 100

15. Conclusion


Understanding Pseudocode


Pseudocode is a plain text description of a piece of code or algorithm. It's not really coding, as there are no scripts, no files, and no programming. As the name suggests, it's “fake code�.


Pseudocode is not written in a specific programming language. The writing method uses simple language to express algorithm designs


Although it is not written in a programming language, there are still keywords that are used that refer to general coding concepts. Pseudocode writing also does not have definite rules but must be logical. It is written in capital letters for easier reading. Here are suggestions for writing Pseudocode:

 1. Use uppercase or capital letters for command codes such as (IF, ELSE, and THEN).

 2. Each statement is written in one line.

 3. Use indents.

 4. Specific.

 5. Simple.


Pseudocode Functions


Pseudocode helps you plan your application before you write it. It helps you create algorithms in a format that is easier to read than code syntax. Once programming languages ​​came along, it became more difficult to understand what your code was doing.


Writing Pseudocode also allows you to get bright ideas in your head without having to worry about programming language syntax. Because it has no special syntax, the program is easy to read and write, and programmers can comfortably communicate ideas and concepts, even if they are working on different programming languages.


Actually the principles of good software are very important. If you are interviewed to be a software engineer, they will not expect you to memorize syntax. They will ask you about your knowledge of algorithms and structures. You will write much better code if You create algorithms and structures before you start coding.


Features of Pseudocode


  * Pseudocode is a notation or sign of how to solve problems systematically and sequentially.

  * Pseudocode is used to write algorithms.

* Pseudocode contains a series of processes to solve problems.

  * The language used is more concise and easy to understand.

  * There are no standard rules for writing Pseudocode.


Pseudocode Structure


Generally in writing Pseudocode is divided into three structures or parts, namely:

 1. Title – Generally in the title section it begins with writing “PROGRAMâ€� which is then followed by the name of the algorithm.

 2. Declaration – This section is the variable that the algorithm has declared. This variable can be an integer, a fraction, a character, a boolean, and so on.

 3. Algorithm – This is the section that contains a set of algorithm commands. Algorithm commands can be loop, conditional or sequential.


Important Points In Writing Pseudocode


 1. Pseudocode will be attached by START (or BEGIN) and STOP (or END).

 2. Pseudocode should be concise so ignore unnecessary details.

 3. To receive data from a user, commonly used statements are INPUT, READ, GET, or OBTAIN.

 4. To display any result or message, commonly used statements are PRINT, DISPLAY, or WRITE.

 5. Commonly used keywords are capital letters.


Advantages and Disadvantages of Pseudocode


Advantages of Pseudocode


  * It is language independent, Pseudocode can be used by most programmers thus allowing developers to express designs in a simple and natural language.

  * Easier to develop programs from Pseudocode compared to flowcharts. Programmers don't have to think about syntax, we just have to concentrate on underscore logic. The focus is on the steps to solving a problem rather than how to use a computer language.

  * It is often easy to translate Pseudocode into a programming language.

  * The use of words and phrases in Pseudocode, which are in the line of basic computer operations simplifies the translation of Pseudocode algorithms into specific programming languages.

  * Unlike flowcharts, Pseudocode uses a simple and easy-to-read structure making it easier to modify.

  * Pseudocode allows programmers to work in multiple computer languages. Pseudocode can be checked more easily by various groups than actual code.


Disadvantages of Pseudocode


  * Does not provide a visual representation of programming logic.

  * There is no accepted standard for writing Pseudocode. Programmers use their own Pseudocode writing style.

  * Pseudocode cannot be compiled or executed and there is no real formative of the syntax rules. This is just one step, which is important, in generating the final code.


Pseudocode Example


The following are some examples of pseudocode, which of course you can use for reference to learn pseudocode.


Example of Pseudocode Entering Favorite Color


START

getColor PROGRAM

Create variable Color

Ask the user's favorite color to the user

READ INPUT into Color

PRINT Color

END


Pseudocode Example Calculating the Circumference of a Circle


START

NUMBER r, perimeterÂ

INPUT rÂ

perimeter=2*3.14*r

perimeter OUTPUT

END


Example of Pseudocode Addition of Two Numbers


START

NUMBER s1, s2, sum

OUTPUT("Input number1:")

INPUT s1

OUTPUT("Input number2:")Â

INPUT s2

sum=s1+s2

OUTPUT sum

END


Modulus Program Pseudocode Example


START

Read bill_bulat

IF bil_bulat mod 2 = 0,

THEN write “even numberâ€� 

ELSE write “odd numberâ€� 

END


Pseudocode Example Printing Numbers 1 To 100


START

NUMBER counter

FORÂ counter = 1 TOÂ 100 STEP 1 DO

  OUTPUT counter

ENDOR

END


Conclusion


So what is Pseudocode? Pseudocode is an informal way of programming description that does not require an official programming language syntax or consideration of the underlying technology. Pseudocode or pseudo code is used to create an outline or rough concept of a program.


The goal is to make it easier for humans to understand compared to using programming languages ​​that are commonly used, especially the aspects that are concise and do not depend on a particular system are the main principles in an algorithm.

Hopefully, this article about What is Pseudocode: Definition, Examples, Functions, and Structures, gives you a little insight. Also, read an article about What is RAD (Rapid Application Development Model)? that you may need to know. Thank you.

Previous Post Next Post