algorithmA sequence of logical instructions for carrying out a task. In computing, algorithms are needed to design computer programs. are a sequence of logical instructions for carrying out a task.
Algorithms are needed to design computer programs. An algorithm will have inputData which is inserted into a system for processing and/or storage. data and should produce outputData which is sent out of a system. data after it has carried out a process. This is known as the input-process-output model.
In the illustration below, input is the dataUnits of information. In computing there can be different data types, including integers, characters and Boolean. Data is often acted on by instructions. coming into the process from outside of the system:
Process is the stage where all the tasks are carried out.
Output is where data comes out after the tasks have been processed.
The storage section sends or keeps additional data needed for the process.
For example, a simple algorithm could take in two numbers (inputs), add them together (process) and print them to the screen (output).
Example
INPUT number1 INPUT number2 total = number1 + number2
OUTPUT total
In the above example:
the inputs are number1 and number2
the process is adding the two numbers together
the storage is assigning the answer to the total variable