2.2 Problem Solving


2.2 Problem Solving

The ultimate goal of developing a computer program is to solve some real-world problem. The real challenge is to find some method of solution or some way to approximate a solution to the problem at hand. If the method of solution to a problem cannot be found (not even an approximation), then there is no point in attempting to construct a program. In reality, there are many types of problems with no known method of solution discovered to date.

2.2.1 Problem Solving Process

Computer problem solving is a creative process; in a simple manner, it involves:

  1. Describing the problem in a clear and unambiguous form

  2. Finding a solution to the problem

  3. Developing a computer implementation of the solution

In order to design the solution to a problem, one has to identify the major parts of a problem:

  • The given data

  • The required results

  • The necessary transformation to be carried out on the given data to produce the final results

2.2.2 Algorithm

In a broad sense, the transformation on the data is described as a sequence of operations that are to be carried out on the given data in order to produce the desired results. Figure 2.1 illustrates the notion of transformation. This is a clear, detailed, precise, and complete description of the sequence of operations. The transformation of the data is also called an algorithm. The algorithm is a formal description of how to solve the problem.

click to expand
Figure 2.1: Transformation applied to the input data.

A program consists of a group of data descriptions and one or more sequences of instructions to the computer for producing correct results when given appropriate data. The program is written in an appropriate programming language, and it tells the computer how to transform the given data into correct results. Software development is a process for producing a program that implements the solution on a computer.




Object-Oriented Programming(c) From Problem Solving to Java
Object-Oriented Programming (From Problem Solving to JAVA) (Charles River Media Programming)
ISBN: 1584502878
EAN: 2147483647
Year: 2005
Pages: 184

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net