Computer Engineering Culminating Activity
Start Here Home Page Begin Learning Final Quiz About the Webmasters Other Resources and Links

Hello, visitor.

Program Flowcharts and Pseudocode

A flowchart is a diagram of an algorithm used to solve a problem. It uses visuals to describe the instructions in the procedure. The structure of a flowchart reflects the computer's "way of thinking" and this will ensure easy translation from the flowchart into a computer language.

The five basic symbols used to draw flowcharts are termination box, processing box, decision box, input/output box, and flow lines. These blocks correspond to the basic functions or instructions of a computer. The termination block starts or ends a flowchart. The Processing block displays the calculations performed. The decision block indicates a true or false situation. The input/output block indicates read and write functions. The flow lines connect the blocks together to display the sequential order of operations.

E.g.  The “Start” symbol identifies the start of the flowchart.
The “Read X” will make the computer read the value of X. In this case, the computer will read 15.  Names such as X, Y, or Z are called variables.
The instruction “Y = 3” will give Y the value of 3.
The instruction “Z = 2 * X + Y” will make the computer calculate and store the content in 33
The instruction “Write Z, X, Y” will cause the computer to write the contents of Z, X, and Y.
The instruction “End” denotes the end of the processing.

Pseudocode (“pseudo” meaning false and “code” meaning converting a piece of information) is a kind of English that describes an algorithm.  Programmers use pseudocode as an alternative to flowcharts.  Since flowcharts use to be hard to alter, pseudocode is easier to create and edit using a word processor.
Pseudocode is text-based code that has the same purpose of flowcharts.  An algorithm is a procedure created to solve a certain problem.  Pseudocode allows programmers to focus on the basic procedure rather than the syntax.  It uses informal descriptions of the tasks to be performed.

Pseudocode is written in sequential order of processing.  Pseudocode is used by programmers develop these algorithms.  The purpose of using pseudocode is that it is easier to understand the descriptions of each step required to solve a problem.  There are no universal conventions for writing pseudocode.  Pseudocode may contain particular languages like Pascal, BASIC, Java, C, Lisp, or ALGOL.

Some guidelines in the creation of pseudocode include mimicking good code and proper English.  Keep the steps and descriptions simple and use group statements (begin, end, brackets).  Do not use a lot of syntax or define each variable.  Use programming short forms to make the text more concise.  Make sure the parameters are included.  Lastly, check the balance of understandability and detail.s


Read Temp
If Temp < 0 Then
Print Temp, “Below Freezing”
Else
If Temp > 0 Then
Print Temp, “Above Freezing”
Else
Print Temp, “Freezing”
End If
End If
Stop


If condition Then
Statement-1
Else
Statement-2
End If


Read N1, N2, N3
If N1 > N2 Then
Large = N1
Else
Large = N2
End If
If N3> Large Then
Large = N3
End If
Print Large
Stop

Previous Page

 

 

 

 

 

 

 

   
© 2009 Tony Xing & Justin Lau.
Canada Wide 2009 Virtual Science Fair
Click to Go Home.