Development Tools :

 

Algorithm & Flowchart

A typical programming task can be divided into two phases:

 

Problem solving phase

¨  produce an ordered sequence of steps that describe solution of problem

¨  this sequence of steps is called an algorithm

 

Implementation phase

¨  implement the program in some programming language

 

Example 1: Write an algorithm to determine a student’s final grade and indicate whether it is passing or failing. The final grade is calculated as the average of four marks

 

n  Detailed Algorithm

n              Step 1:             Input M1,M2,M3,M4

Step 2:             GRADE ¬ (M1+M2+M3+M4)/4

Step 3:             if (GRADE < 50) then

Print “FAIL”

else

Print “PASS”

endif

 

 

The Flowchart

 

n  (Dictionary) A schematic representation of a sequence of operations, as in a manufacturing process or computer program.

n  (Technical) A graphical representation of the sequence of operations in an information system or program. Information system flowcharts show how data flows from source documents through the computer to final distribution to users. Program flowcharts show the sequence of instructions in a single program or subroutine. Different symbols are used to draw each type of flowchart.

 

A Flowchart

¨  shows logic of an algorithm

¨  emphasizes individual steps and their interconnections

¨  e.g. control flow from one action to the next

 

Flowchart Symbols

flow chart symbols

Example

flow chart example

n  Write an algorithm and draw a flowchart to convert the length in feet to centimeter.

example 2

n  Write an algorithm that reads two values, determines the largest value and prints the largest value with an identifying message.

example 3

 

 

 

Registration


A password will be e-mailed to you.

Feedback Form

Name (required)

Email (required)

Feedback