No matter which programming languages, software developers are planning to use, reasoning and sequencing of their work should be the same. Remember, their job is to make the computer “run a routine” to give to us, the users, the results we are looking for. Do this job, requires that the Developers use two important tools: the Formation of Algorithms and the Flow Diagrams.
Now, consider the way in which a computer solves a problem.
- Firstly, there must be a list of instructions written by the man to solve this problem, which we know under the name of program, and must be stored in the resident memory of the computer.
- To the order of commencement of implementation of the program, the control unit is responsible to execute the instructions in the order determined by the program, by transferring the unit logic-arithmetic the execution of operations and comparisons, and receiving of the intermediate and final outcomes.
- Once finished the process of calculations, the control unit proceeds to send these results to the units of output for use by the user. This procedure will be executed as many times as we tell it is the computer and always in the same way.
We must always bear in mind the fact that the computer only does what the user ordered. This means that the mistakes that may exist in the results provided by the computer, are merely consequences of mistakes made in the program that is running or data entered by users.
As a general rule, there are three steps to be followed for the solution of a problem through the computer:
- Determine the problem we want to solve.
- Develop the finite model of the problem.
- Based on the finite model, get an algorithm.
The determination of problems not always is as easy as it might seem. Often the omission of this step has caused the loss of a large number of hours of work, for not having previously defined objectives wanting to achieve.
This work is usually set between the user and the programmer, and no other steps should get ahead without having previously concluded it.
The development of the finite model basically consists of the collection of all the elements involved in the variations of the problem (called variables), and determination of the mathematical or logical relationships among them.
Finally, programmer must analyze the obtained model and work on the formation of the algorithms. This term defines a series of instructions in a given sequence, necessary to describe the operations that lead to the solution of a problem.
An algorithm approach can be done in many ways, however, in computing is often used as graphics to be such as to allow a better visualization of the sequence in which instructions that make up this algorithm must be run.
Representation graph of algorithms, known by the name of Flow Diagrams, and consists of a set of symbols that are connected to each other, representing the sequence and type of process to be held in each of the stages of solving a problem.
The symbols most commonly used to make a flowchart, are as follows:
Then, we can see an example of very basic flowchart that defined an algorithm to make a machine to make separation and selection of two different coins and present a result on the number of coins by type.