Before
writing a computer program, we must be clear about the processing steps to be
performed by the computer. Hence, in order to ensure that the
program/instructions are appropriate for the problem and are in the correct
sequence, program must be planned before they are written. The problem solving
contains a number of steps which are as below.
Steps in problem solving by Computer
1)
Problem Analysis:
Before solving a
problem, it should be analyzed well. It is impossible to solve a problem by
using computer without clear understanding & identification of the problem.
Thus, problem analysis contains different activities like determining
input/output, software and hardware requirement, time constraints, different
types of users, accuracy etc.
2)
Algorithm Development:
Algorithm is step
by step description of the method to solve a problem. In other words, it can be
defined as a sequence of instructions designed in such a way that if the
instructions are executed in the specified sequence, the desired result is
obtained.
Example: write an algorithm to solve the
problem which tests a number for even or odd.
Step1: Start
Step2: Read a number.
Step3: Divide the number by 2 and check the remainder.
Step4: If the remainder in step 3 is zero,
Display the number as
even otherwise as odd.
Step5: Stop.
3)
Flowchart:
Flowchart
is the graphical representation of the algorithm using standard symbols. In
other words, flowchart is a pictorial representation an algorithm that uses
boxes of different shapes to denote different types of instruction. The actual
instructions are written within these boxes using clear statement. The boxes
are connected by solid lines having arrow marks to indicate the flow of
operation.
Flowchart Symbols
Example
of flow chart:
Draw flowchart to solve the problem
which tests the number for even or odd.
4)
Coding:
This is the process of transforming the
program logic design into a computer language format. This stage translates the
program design into computer instructions. These instructions are the actual
program or software product. It can be said that coding is the act of
transforming operations in each box of the flowchart in terms of the statement
of the programming.
5)
Compilation and Execution:
The process
of changing high level language into machine level language is known as
compilation. It is done by a compiler. Once the compilation is completed then
the program is linked, loaded and finally executed. The original high level
language is called the source program and the resulting machine language
program is called object program.
6)
Debugging & Testing:
Debugging is the
discovery and correction of programming errors. Even after taking full care in
program design, some errors may remain in the program because the designer
might have never thought about a particular case. These errors are detected
only when we start executing the program in a computer. Such types of program
errors are called BUGS and process of removing these BUGS is knows as
debugging.
Testing is the
validation of the program. Testing ensures that program performs correctly the
required tasks. The program testing and debugging are closely related.
7)
Program Documentation:
Documentation of
program helps to those who use, maintain and extend the program in future.
Properly documented program is useful and efficient in debugging, testing,
maintenance and redesign process. A properly documented program can easily be
used again when needed and an undocumented program usually requires much extra
work. Among the techniques commonly found in documentation are flowcharts,
comments, memory maps, and parameter & definition list.
Comments
Post a Comment