Tuesday, January 14, 2014

Pseudocode is an artificial and informal language that helps programmers develop algo-
rithms. The pseudocode we present is particularly useful for developing algorithms that
will be converted to structured portions of C# programs. Pseudocode is similar to everyday
English; it is convenient and user-friendly, and it is not an actual computer programming
language.
   
     Pseudocode is not executed on computers. Rather, pseudocode helps the programmer
“think out” a program before attempting to write it in a programming language, such as C#.
In this chapter, we provide several examples of pseudocode algorithms.


         Software Engineering Observation 4.1
Pseudocode helps the programmer conceptualize a program during the program design pro-

cess. The pseudocode may then be converted to C#.        

     The style of pseudocode that we present consists solely of characters, thus program-
mers may type pseudocode conveniently using an editor program. Programmers can con-
vert  carefully  prepared  pseudocode  programs  to  corresponding  C#  programs  easily.  In
many cases, this conversion takes place simply by replacing pseudocode statements with
their C# equivalents.
     Pseudocode normally describes only executable statements—the actions that are per-
formed when the pseudocode is converted to C# and executed. Declarations are not execut-
able statements. For example, the declaration

          int i;

informs the compiler of the type of variable i and instructs the compiler to reserve space
in memory for this variable. This declaration does not cause any action, such as input, out-
put or a calculation, to occur when the program executes. Some programmers choose to list
variables and their purposes at the beginning of a pseudocode program.
    

0 comments:

Post a Comment

Subscribe to RSS Feed Follow me on Twitter!