Sunday, 8 December 2013

Algorithms Research - Flowcharts & Structured English



Lalin, you WILL have the other blog posts done, but I cannot do them for Monday. I gave up two frees on Friday to get my coursework on track, which meant that I didn't do the work set for Friday's History lesson (she set work despite not being there) and obviously I had work on Saturday. Today has been the only day I could do work and I had the History work from Friday due Tuesday (but it's an hour and half's work), Law and English coursework due in for Monday. Obviously I spent most of today doing my English, which still isn't finished. So I'm doing this homework and on Wednesday, after the photoshoot, I shall do the rest of my blogs!

Algorithm Research - Flowcharts & Structured English

An algorithm is defined as a set of finite instructions written to solve a specific task, which is generic and programming-language independent

This is research, so all the other stuff will appear in a later blog :).

Flowcharts -
The flowcharts have basic symbols, which are recognised by most, but not all, programmers.

Examples of symbols which can be used in flowcharts:
 -Indicates the start or end of a program.
- Is used for decision making and branching.
 - Indicates any inputs and outputs.
 - This is the symbol for the connector, which joins two parts of a program together.
 - Indicates a process or instruction.
 - For any commentselaborations or definitions.

Although these are the main symbols, they are not the only symbols used, there are others which can be implicated.

A few things that should be noted when creating flowcharts:


  • Flowcharts should be clear and easy to follow. 
  • There should be no ambiguous steps. 
  • The direction of flow should remain consistent .
  • Only one flow line should come from a process symbol.
  • Only one flow line should enter a decision symbol, but several can leave it.
  • Flowcharts should have a start and a finish.
  • Testing flowcharts with test data is a good idea to ensure that the algorithm is as clear and uncomplicated as possible.
An example flowchart would be:
This particular flowchart is for finding out the average of two numbers.

Structured English -

This type of algorithm is similar to that of pseudo-code. However, most of the steps have few symbols or terms which relate to programming whatsoever.

An example algorithm would be:

Begin
Read name
   If name equals "Harry" Then
      Write "Why don't you marry Pippa?"
   Else 
      Write "Are you royal enough?"
   End if
End

To show the difference between Structured English and Pseudo-code here are is an example:
Structured English:
Multiply Number1 by Number2 to get product

Pseudo-code:
Product <-- Number1 * Number2


And that's pretty much all there is to it.
Will probably come back and edit this over Christmas anyway, because it's awful. Sorry Lalin :(.