This weak, we discussed about the Flowcharting and algorithms
Flowcharting is defined as
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
Preparation/Initialization
Signifies the preparation of data.
Used to select initial conditions.
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.
Decision
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.
Basic Control Structures
Sequence
Selection (if-then-else)
Repetition (Looping)
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.
Arithmetic Operators
+ addition
- Subtraction
* Multiplication
/ Division
= equal
> Greater than
<>
<> Not equal
> Greater than or equal to
< less than or equal to
Logical operators
&& AND
|| OR
! NOT
No comments:
Post a Comment