You are not logged in.

#1 2015-06-12 10:48:29

User RankUser RankUser RankUser RankUser RankUser Rank
From: Chichawatni,Pakistan
Registered: 2014-10-03
Posts: 8,129


What is Pseudocode?

Pseudocode is an artificial and informal language that helps programmers develop algorithms. Pseudocode is a "text-based" detail (algorithmic) design tool.
Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading.The rules of Pseudocode are reasonably straightforward. All statements showing "dependency" are to be indented. These include while, do, for, if, switch. Examples below will illustrate this notion.



Print out appropriate heading and make it pretty
While not EOF do:
     Scan over blanks and white space until a char is found
    (get first character on the line)
     set can't-be-ascending-flag to 0
     set consec cntr to 1
     set ascending cntr to 1
     putchar first char of string to screen
     set read character to hold character
     While next character read != blanks and white space
          putchar out on screen
          if new char = hold char + 1
               add 1 to consec cntr
               set hold char = new char
          if new char >= hold char
               if consec cntr < 3
                    set consec cntr to 1
               set hold char = new char
          if new char < hold char
               if consec cntr < 3
                    set consec cntr to 1
               set hold char = new char
               set can't be ascending flag to 1
     end while
     if consec cntr >= 3
          printf (Appropriate message 1 and skip a line)
          add 1 to consec total
     if  can't be ascending flag = 0
          printf (Appropriate message 2 and skip a line)
          add 1 to ascending total
          printf (Sorry message and skip a line)
          add 1 to sorry total
end While
Print out totals:  Number of consecs, ascendings, and sorries.

You cannot discover the new oceans unless you have the courage to lose the sight of the shore.

2015-06-12 10:48:29

Ads By Google

Re: Pseudocode

Board footer