Wednesday, August 19, 2015

Preliminaries

In a computer, the driver is a set of instructions called a program. More formally, a
computer program is a self-contained set of instructions used to operate a computer to produce
a specific result.
At its most basic level, a program is a solution developed to solve a particular problem,
written in a form that can be executed on a computer. Therefore, writing a program is almost
the last step in a process that first determines the problem to be solved and the method to be
used in the solution. Each field of study has its own name for the systematic method of designing
solutions to solve problems. In science and engineering, the approach is referred to as the
scientific method, and in quantitative analysis, the approach is called the systems approach.
Professional software developers use the software development procedure for understanding
the problem to be solved and for creating an effective, appropriate software solution. This
procedure, illustrated.
 Phase I: Development and Design
Phase I begins with a statement of a problem or a specific request for a program, which is
referred to as a program requirement. After a problem has been stated or a specific request for
a program solution has been made, the development and design phase begins. This phase
consists of four well-defined steps, illustrated in Figure 1.3
 Step 1: Analyze the Problem The analysis of a problem can consist of up to two parts. The
first part is a basic analysis that must be performed on all problems; it consists of extracting
the complete input and output information supplied by the problems. For this analysis,
you must
1. Determine and understand the output items the program must produce.
2. Determine the input items.
Together, these two items are referred to as the problem’s input/output (I/O). Only after
determining a problem’s I/O can you select specific steps for transforming inputs into outputs.
At this point, doing a hand calculation to verify that the output(s) can indeed be obtained from
the inputs is sometimes necessary and/or useful. Clearly, if you have a formula that relates
inputs to the output, you can omit this step. If the required inputs are available and the desired
outputs can be produced, the problem is said to be clearly defined and can be solved.
For a variety of reasons, completing a basic analysis might not be possible. If so, an
extended analysis might be necessary. An extended analysis simply means you must gather
more information about the problem so that you thoroughly understand what’s being asked for
and how to achieve the result. In this book, any additional information required to understand
the problem is supplied along with the problem statement.
Step 2: Develop a Solution In this step, you select the exact set of steps, called an
“ algorithm,” to be used to solve the problem. Typically, you find the solution by a series of
refinements, starting with the initial solution you find in the analysis step, until you have an
acceptable and complete solution. This solution must be checked, if it wasn’t done in the
analysis step, to make sure it produces the required outputs correctly. The check is usually
carried out by doing one or more hand calculations that haven’t been done already.
For small programs, the selected solution might be extremely simple and consist of only
one or more calculations. More typically, you need to refine the initial solution and organize it
into smaller subsystems, with specifications for how the subsystems interface with each other.
To achieve this goal, the solution’s description starts from the highest level (top) requirement
and proceeds downward to the parts that must be constructed to meet this requirement. To
make this explanation more meaningful, consider a computer program that must track the