What is Problem and problem solving in programming?

problem solving in programming

A task that needs to complete in programming is called problem. It is necessary to understand the problem before solving it. A good programmer has excellent problems solving qualities. Problems are studied in detail for getting correct solutions and needs full attention while analyzing the problem because good analysis results correct solution and bad analysis results incorrect solution.

Problem Solving

Problem solving is a process of identifying a problem and finding the best solution for it. Problem solving is a skill that can be developed by following well organized approaches. Different problems are different in nature and have different solutions. A solution cannot be used for all the problems. There will be more than one solution for a problem so we need to select faster, less expensive and more reliable than others.

Different strategies, techniques and tools are used to solve a problem. Computers are used as tool o solve complex problems by developing computer programs. A person who writes computer programs is called “programmer”. A person can be a good programmer if he has excellent skills of problem solving.

 Different problem solving techniques are as follows:

  1. Program
  2. Algorithm & Pseudo Code
  3. Flowchart


Program

As we know that computer works according to instructions given to it. These instructions can be given by mouse or keyboard after clicking buttons or pressing some keys. Programs can be used to solve different problem in computer.

“A precise set of instructions given to computer for performing some specific task is called Computer Program.”

Algorithm & Pseudo Code

An algorithm is a step-by-step procedure to solve a problem. The process of solving a problem becomes easier and simpler with the help of algorithms. It is better to write algorithm before writing actual computer program. Algorithms are written in a language that is similar to simple English language called “Pseudo Code”.

 For Example : Write an Algorithm to input two numbers, calculate sum and display result.


1. START
2. INPUT A
3. INPUT B
4. Total = A + B
5. DISPLAY Total
6. EXIT

Flowchart

It consist of two words, flow and chart. A chart consists of many symbols to display information about any program. Flow indicates the direction of processing that takes place in the program. Flowchart is graphically representation of an algorithm. It is used to visualize the flow of data, operation perform on data and sequence of these operations.

A designer draw flowchart of specific problem and then computer programmer translate all operations into program. It is important to draw flowchart before writing computer program.

Flowchart Symbols : Flowchart use simple symbols to represent solution of a problem.

INPUT/OUTPUT

Parallelogram symbol is used to represent an input or output step. Input statement is used to get input from user. The output statement is used to display a message to user or to display a value.

PROCESS
Rectangle symbol is used to represent a process step. A process may be a complex calculation or simply an assignment statement.

CONDITION

Diamond symbol is used to represent a selection / condition step. A condition is given in diamond. The flow of control from diamond may go in two directions. One direction when condition s true and one direction when condition is false.

START / END

Oval symbol is used to represent the start and end of flowchart.

FLOW-LINES

Arrow symbols are used to represent direction of flow in flowchart. There are four types of flow lines. Up line, Down line, Left line, Right line.

CONNECTOR
Circle symbol is used to combine different flow line. It is used when two or more flow symbols come from different directions and move to one direction.

FUNCTION CALL

Rectangle symbol with double lines on left and right sides is used to call a function. The name of the function with parameters is written inside the symbol.

OFF-PAGE CONNECTOR

If flowchart is larger than a page then remaining part of the flowchart can be moved to next page and off page connector is used to connect all pages.

Post a Comment

Previous Post Next Post