COMPUTER PROGRAMMING
By definition Program is a sequence of instructions given to the computer to accomplish a task or solve a given problem. The process by which a user specifies to the computer in a particular programming language such as BASIC, COBOL what he want computer to do is referred to as programming. Since the computer cannot think on its own, it’s the user ( called a programmer) that will give the details steps, as well as the sequence in which the steps are to be taken in solving a problem.
PROGRAMMING PROCEDURE
The first step in the development is of a (non-trivial) program is program designed. This is achieved by developing a suitable algorithm through flowchart or pseudo-code. An Algorithm is a step by step procedure in solving a given task. Flowchart is diagrammatic expression algorithm. Pseudo-code is an English like expression of algorithm which show the step by step procedure of solving a specific problem.
Examples of Algorithms in Pseudo-code
Example1: An Algorithm of a program to calculate and output the area of rectangle
STEP1: INPUT LENGTH
STEP2: INPUT BREATH
STEP3: LET AREA = LENGTH * BREADTH
STEP4: OUTPUT AREA
STEP5: STOP
Example2: An Algorithm to calculate and output the area of triangle
STEP1: INPUT BASE
STEP2: INPUT HEIGHT
STEP3: LET AREA = (BASE * HEIGHT) / 2
STEP4: OUTPUT AREA
STEP5: STOP
We will be talking about flowchart in the next chapter. Thanks for following us
0 Comments