Pages

Translate

Monday, 11 June 2012

Tools Used In Problem Solving (Pseudocode & Flowcharts)

Carrying on from where i left off with the last post where i talked about algorithm,i'll be looking at pseudocode and flowcharts. Two more tools used in problem solving when it comes to Logic building.

PSEUDOCODE:
The pseudocode is a detailed readable description of what an algorithm must do,expressed in a formally styled natural language rather than a programming language.
It is easy and fast to write since it uses english statements and can easily be converted to a program using any programming language but it might also be difficult to understand the complex logic in a pseudocode as it does not provide a graphical representation of an algorithm like the flowchart does.

FLOWCHARTS:
A flowchart can simply be defined as the graphical representation of an algorithm. It uses symbols to represent the activities depicted in an algorithm. It also requires the I-P-O cycle to solve problems,but here the processing would involve the computations and the decisions that are been taken.
The flowchart helps in analyzing the problems effectively and act as a guide during the program development phase. However it can be time consuming and a lengthy flowchart may extend over multiple pages which reduces readability. One should also be carful to avoid mistakes as a change made to a single step may cause redrawing the entire flow chart.
One will know the symbols used when preparing a flow chart and their meanings if your familiar with microsoft office.
Here's an example of an algorithm that displays the sum of two numbers presented in both pseudocode and flowchart.

ALGORITHM                                           PSEUDOCODE PRESENTATION
STEP 1:Start the algorithm                          Begin
STEP 2:Get the first number                            Accept firstnumber
STEP 3:Get the second number                       Accept secondnumber        
STEP 4:Add the two numbers                         Compute sum as firstnumber +
STEP 5:Display the result                                + secondnumber
STEP 6:End the algorithm                               Display Sum
                                                                  End
FLOWCHART PRESENTATION


.
Please it should be noted that these examples i've given are without variables.....till next time.

3 comments:

  1. Please I will like u or any one here to help me out,I am a networking student and am to solve this:---Draw a flowchart to a number from 1 to 7 & display the corresponding day of the week.pls use d diagram charts.thanks

    ReplyDelete
  2. Thanks for the info! I have also recently found a site that has Flowchart Symbols Meaning Explained and it is very helpful! I would recommend it to all!

    ReplyDelete
  3. Which tool is best for solving complex problem
    flowchart algorithm pseudocode

    ReplyDelete