Algorithm and Flowchart Flashcards
Algorithm
It is a written list of step-by-step instructions for solving a problem that terminates after a finite number of steps.
Flowchart
A graphic representation of the flow of code using different shapes and arrows.
Give the 6 Properties of Algorithm
- Finiteness
- Absence of Ambiguity
- Scope definition
- Sequence of Execution
- Effectiveness
- Input and Output
Finiteness
Has an exact number of steps to be taken and an end.
Absence of Ambiguity
Every instruction is precisely described and clearly specified.
Sequence of Execution
Program is executed from top to bottom.
Input and Output
The unknowns of the problem is defined and there is an expected outcome.
Effectiveness
The solution is guaranteed to give a correct answer and the specified instructions are carried out.
Scope Definition
Applies to specific problem and class.
5 steps in Program Development
- State the problem clearly
- Plan and write the logical order of instructions
- Code the program
- Enter the program into the computer
- Run and debug the program
A problem cannot be solved unless understood properly.
State the problem clearly
The computer follows exactly the given instructions
Plan and write the logical order of instructions
Write the programming statements in the desired language.
Code the program
Type the statement into the computer
Enter the program into the computer
Check if you got the desired output; correct the error if there’s any.
Run and debug the program
Pseudocode
Written algorithm with the use of human language that is easier to control or modify.
Terminal
For the start and end poinys of a program
Initialization
Preparation of memory space for data processing and declaration of the constants
Input/Output
Used for Input of data for processing and printing of the processed data (output ).
Process
Manipulation of data (assignment and arithmeic computations)
Flow lines
Defines the logical flow of sequence of the program.
On-page connector
Connects to the flowchart on the same page to avoid spaghetti connection.
Off-page connector
Connects to the flowchart on the next page to avoid spaghetti connection.
Decision
For processing conditions using relational operators to filter data.
while/end while
condition checked before loop
repeat/until
condition checked after loop
Flowchart Advantages
- Standardized
2. Visual
Pseudocode Advantages
- Easy to modify
- Can be made using a Word Processor
- Implements structured concepts
Flowchart Disadvantages
- Hard to modify
- Structured concepts are not implemented
- Special software required
Pseudocode Disadvantages
- Not visual
2. Not a standard since it depends from company to company