Program and programming languages
Computer follows an I-P-O cycle. It needs set of instructions called program to specify the input required, process to be followed, and the output required.
Program is written in a specific language called Programming Language, so that computer can understand the instructions.
Let us understand Program and Programming Language more in detail.
Program
How does a computer know what are the steps to be followed to process reservation requests? How does it manage to calculate your shopping bills at the local store? How does it generate your report card at school? Is it an all- knowing machine? Do you have to buy a different computer for each of these above-mentioned activities? The answer to the last two questions is 'No'. It is not an all-knowing machine and you do not require a separate computer for each of these activities.
Then, how does computer function? A computer is designed to accept input, process it, and generate output. However, it has to be provided with a set of instructions that state the following:
1. The kind of input that will be provided . For example, in the case of reservation request, flight date, flight time, class, and destination will be some of the inputs.
2. The kind of output expected. for example, the seat availability status.
3. The processing that needs to be done. for example, accepting the values, checking for availability of seats, and displaying results.
A set of instructions to perform a particular job is called a program. Therefore, for each job that you want the computer to perform, you require a separate program. Instruction in a program can be:
1. Sequential: Instructions that are executed one after the other
2. Decision Making: Instruction that evaluate an expression (relation or condition) first and then, depending upon whether the value of the expression is 'true' (non-zero) or 'false' (zero), it transfers the control to a particular statement.
Determining The Efficiency of an Algorithm
3. Iterative: Instructions that are executed repeatedly, depending on the value of an expression (relation or condition).