How to make a flowchart?
November 26, 2019
Modern Fields
December 25, 2019

A guide to pseudocode

Hi, in this post I will explain you what is pseudocode. And how to use it, and I will also guide you through how you can make your own pseudocode.

What is Pseudocode?

In order to learn the skill, you have to understand what is that skill. Same goes on here, we will first have to look that what exactly is pseudocode. So, pseudocode is:

“Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm.”

In simple words, it is simplified program which is understandable by humans. It is much simple to understand, and after this you can use it in your code too, in computer’s language. Now before telling you how to actually write it, let’s see it’s advantages.

Advantages:

  1. It improves your understanding of the algorithm.
  2. It acts as a bridge between the program and the flowchart.
  3. It helps you to understand the flow
  4. It explains you what each line do in a program which is it’s main goal.

Now let’s see how exactly we can write it.

How to write it?

In order to write it, you have to keep the problems in the mind and what you want to do throught the program in your mind. If you have the above things then you can write it by following the steps given below:

  1. Arrange the tasks which are in sequence, and write the pseudocode accordingly to it.
  2. Always start with a statement which explains that what exactly this program does.
  3. Write some if and else situations, for, while loop situations. So when you are writing the real code you can understand these statements easily.
  4. Always name properly, because your code is meant to be understand by a human
  5. Use proper sentence formings.
  6. Always use CamelCase for methods.
  7. Use upper case for constants
  8. Use lower case for variables
  9. Give a short description of what is going to happen in the code. Don’t write your pseudocode directly.
  10. Use comments to explain a little bit.
  11. Do not write it in a programmatic manner

Examples:

1.. If student’s grade is greater than or equal to 60

    Print “passed”

else

    Print “failed”

2. Set total to zero

Set grade counter to one

While grade counter is less than or equal to ten

    Input the next grade
    Add the grade into the total

Set the class average to the total divided by ten

Print the class average.

3.

Initialize total to zero

Initialize counter to zero

Input the first grade

while the user has not as yet entered the sentinel

    add this grade into the running total
    add one to the grade counter
    input the next grade (possibly the sentinel)

if the counter is not equal to zero

    set the average to the total divided by the counter
    print the average

else

    print ‘no grades were entered’

4.

initialize passes to zero

initialize failures to zero

initialize student to one

while student counter is less than or equal to ten

    input the next exam result
    • if the student passed

      • add one to passes

else

    • add one to failures

add one to student counter

print the number of passes

print the number of failures

if eight or more students passed

    print “raise tuition”
adobe illustrator cs6 crack
fl studio 12.5.1.5 regkey
batterybar pro 3.6.6 full crack
bagas31 corel x6