Pseudocode and Flowcharts
Algorithm
An algorithm is a set of steps to be followed in solving some particular problem. Flowcharts and pseudo-codes are representations of algorithms.
―Natural‖ language NOT programming language
flowchart
Flowcharts are written with program flow from the top of a page to the bottom. Each command is placed in a box of the appropriate shape, and arrows are used to direct program flow.
In computing, there are dozens of different symbols used in flowcharting (there are even national and international flowcharting symbol standards). In business process analysis, a couple of symbols are sufficient. A box with text inside indicates a step in the process, while a diamond with text represents a decision point. See the figure for an example.
General Rules for flowcharting
- All boxes of the flowchart are connected with Arrows. (Not lines)
- Flowchart symbols have an entry point on the top of the symbol with no other entry points. The exit point for all flowchart symbols is on the bottom except for the Decision symbol.
- The Decision symbol has two exit points; these can be on the sides or the bottom and one side.
- Generally a flowchart will flow from top to bottom. However, an upward flow can be shown as long as it does not exceed 3 symbols.
- Connectors are used to connect breaks in the flowchart. Examples are:
• From the bottom of the page to the top of the same page.
• An upward flow of more then 3 symbols
6. Subroutines and Interrupt programs have their own and independent flowcharts.
7. All flow charts start with a Terminal or Predefined Process (for interrupt
programs or subroutines) symbol.
8. All flowcharts end with a terminal or a contentious loop.
Pseudocode
Pseudocode is a method of describing computer algorithms using a combination of natural language and programming language. It is essentially an intermittent step towards the development of the actual code.
It allows the programmer to formulate their thoughts on the organization and sequence of a computer algorithm without the need for actually following the exact coding syntax. Although pseudocode is frequently used there are no set of rules for its exact implementation. In general, here are some rules that are frequently followed when writing pseudocode:
- The usual Fortran symobols are used for arithmetic operations (+, -, *, / , **).
- Symbolic names are used to indicate the quantities being processed.
- Certain Fortran keywords can be used, such as PRINT, WRITE, READ, etc.
- Indentation should be used to indicate branches and loops of instruction.
Introductory Examples of Flowcharts and Pseudocode
QUIZ
Welldone
ReplyDelete