Friday, August 29, 2008

Learnings of the Week (Quennie Rose Colegado)

This weak, we discussed about the Flowcharting and algorithms
Flowcharting is defined as
A common method for defining the logical steps of flow within a program by using a series of symbols to identify the basic input, process and output function within a program.
A two-dimensional representation of an algorithm; the predefined graphic symbols of a flowchart are used to indicates the various operations and the flow of control .

Algorithm is a finite set of instructions that specify a sequence of operations to be carried out in
order to solve a specific problem or class of problems.

Basic Symbols Used in Flowcharting
Terminal

Used to signify the beginning and end of flowchart.

Preparation/Initialization

Signifies the preparation of data.

Used to select initial conditions.

Used to represent instructions or groups of instructions that will alter or modify a program’s course of execution.


Input/Output
Shows input and output. Data are to be read into the computer memory from an input device or data are to be passed from the memory to an output device.

Processing

Performs any calculations that are to be done.

Decision

Signifies any decisions that are to be done

On-page Connector

Shows the entry or exit point of the flowchart.

A non-processing symbol used to connect one part of a flowchart to another without drawing flow lines.

Conserves space by keeping related blocks near one another, reduces the number of flow lines in complex programs, and eliminates cross lines from taking place.

Off-page Connector

Designates entry to or exit from one page when a flowchart requires more than one page.

Flowlines

Signifies the process that is to be executed next.

Basic Control Structures

Sequence

Selection (if-then-else)

Repetition (Looping)

Sequence

A process executed from one to another in a straightforward manner.

Repetition (Looping)

This structure provides for the repetitive execution of an operation or routine while the condition is true. The condition is evaluated before executing any process statement. As long as the condition is true, the process is executed, otherwise, control flows out of the structure.

Example of Repetition (Looping)

Construct a flowchart that will count from 1 to 10 and print each number counted using the do-while-repetition structure .Write its equivalent algorithm.

Commonly Used Operators in Flowcharting

Arithmetic Operators

+ addition

- Subtraction

* Multiplication

/ Division


Relational Operators

= equal

> Greater than

<>

<> Not equal

> Greater than or equal to

< less than or equal to

Logical operators

&& AND

|| OR

! NOT

No comments: