Programing Problem Solving
February 07, 2019
What is programming Problem Solving
Problem solving is a process of identifying a problem and
finding the best solution for
We solve different problems every day. Every problem is
different in its nature. Some problems are very difficult and require more
attention to identify the solution. A problem may be solved in different ways.
One solution may be faster, less expensive and more reliable
than others. It is important to select the best suitable
solution.
Different strategies, techniques and tools are used to solve
a problem. Computers are
used as a tool to solve complex problems by developing
computer programs. Computer
programs contain different instruction for computer. A
programmer writes instructions and
computer executes these instructions to solve a problem. A
person can be good programmer
if he has the skill of solving problems. Different
problem-solving techniques are as follows:
Program
Algorithm
Flowchart etc.
A set of instructions that tells a computer what to do is
called program. A computer
works according to the given instructions in the program,
Computer programs are written in
programming languages. A person who develops a program is
called programmer. The
programmer develops programs to instruct the computer how to
process data to convert into
information. Programmer uses programming languages or tools
to write programs.
Advantages of
Computer Program
Different advantages of computer program are as follows:
- A computer program can solve many problems by giving instructions to computer.
- A computer program can be used to perform a task repeatedly and quickly.
- A program can process a large amount of data easily.
It can display the results in different styles.
• The processing of a program is more efficient and less
time consuming.
• Different types of programs are used in different fields
to perform certain tasks.
Algorithms & Pseudo Code
An algorithm is a step-by-step procedure to solve a problem.
The process of solving a
problem becomes simpler and easier with help of algorithm.
It is better to write algorithm
before writing the actual computer program.
Properties of
Algorithm
Following are some properties of an algorithm:
- The given problem should be broken down into simple and meaningful steps.
- The steps should be numbered sequentially.
- The steps should be descriptive and written in simple English.
code. There is no standard to write pseudo code. It is used
to specify program logic in an
English like manner that is independent of any particular
programming language. Pseudo code type
pseudo code simplifies program development by separating it
into two main parts.
Logic Design
In this part, the logic of the program is designed. we
specify different steps required to
solve the problem and the sequence of these steps.
Coding
In this part, the algorithm is converted into a program.
steps of algorithm are translated into instructiorts of any programming
language.
The use of pseudo code allows the programmer to on the planning
of the program. After the planning is final, it can be written in any
programming language.
Example
following algorithm inputs two numbers, calculates sum and
then displays
result on screen.
1. Start
2. Input A
3. Input B
4. Total -A + B
5. Display Total
6. Exit
Example
The following algorithm inputs radius from the user and
calculates the area of circle.
(Area 3.14 * radius * radius)
1. Start
2. Input radius in r
3. area 3.14 * r* r
4. Print area
5. End
Example
The following algorithm calculates the distance covered by a
car moving at an average
speed of V m/ s in time T. It should input average speed v
and time t.
( s Vt where s is the distance traveled).
1. Start
2. Input average speed in v
3. Input time in t
5. Print s
6. End
Example
The following algorithm finds the sum of first fifty natural
numbers.
I. Start
2. sum 0
3. N=0
4. Repeat step 5 and 6 While (N 50)
5. sum sum + N
6. N+N+1
7. Print sum
8. Exit