Please enable JavaScript.
Coggle requires JavaScript to display documents.
Algorithms and Flowcharts - Coggle Diagram
Algorithms and Flowcharts
What are algorithms?
It is a combination of phrases and events that can be arranged as steps to solve a specific problem
Example:
When we borrow some books from the library, the remaining books number (N) is the subtraction of the borrowed books number (Nb) From the original number (N0). To write the algorithm for this simple problem we will follow these steps
Input the number of books in the library (NO).
Input the number of borrowed books (NB).
Find the remaining books number (NR), NR = NO-NB
Print NR
What are Flowcharts?
Flowcharts are graphs that represent the formal view used to solve any problem.
Flowcharts help the programmer to write his
program.
Flowcharts consist of a shapes
connected by a straight lines.
shapes and their operations.
We can summarize the use of algorithms and flowcharts
as follow:
To show the mathematical logic used to solve problems
To show how the data processing is done.
Helps the programmer to write his program.
Divides the big problem to smaller parts.
To avoid the errors that occurred during writing the program
It is a middle step between problem difficulty and its conversion to suitable program.
Easy to convert it to any programming language.
In general, we can divide flowcharts to a four
shapes (charts):
Simple sequence charts: The events arrangement of this type is as straight sequence from the beginning of the program to the end (Event-1 to Event-n in figure below). This type of charts does not have any branches or loops.
Branched charts: The need for the branching is to make decisions or comprasion between two or more choices
Single loop charts: These charts are used when we need to repeat an operation or group of operations to specific (or no specific) number of times. These type of charts are used to create the counters.
Multi-loops charts: Its so called because it contains many loops. These loops are nested together without intersection. The priority of execution will be to the internal loops then sequentialy to the internal loops
What is a program?
A program is a set of instruction gave to the computer to execute successive operations leads to solve specific problem.
In general to solve any problem in computer we must follow these steps:
Analyze the problem.
Write an Algorithm.
Draw flowchart.
Convert the flowchart to program.
Run the program and test the solution.