Software Life Cycle
Software Life Cycle
Software Life Cycle
Fatima Bahjat
Algorithms
A sequence of precise instructions which leads to a solution is called an algorithm. Some approximately
equivalent words are recipe, method, directions, procedure, and routine. The instructions may be
expressed in a programming language or a human language.
A computer program is simply an algorithm expressed in a language that a computer can understand. Thus,
the term algorithm is more general than the term program.
Pseudocode is a mixture of C++ (or some other programming language) and English (or some other natural
language). Pseudocode is used to express algorithms so that you are not distracted by details of C++ syntax.
(1) Input- There should be 0 or more inputs supplied externally to the algorithm.
(2) Output- There should be at least 1 output obtained.
(3) Definiteness- Every step of the algorithm should be clear and well defined.
(4) Finiteness- The algorithm should have finite number of steps.
(5) Correctness- Every step of the algorithm must generate a correct output.
Program Design
Designing a program is often a difficult task. There is no complete set of rules, no algorithm to tell you how
to write programs. Program design is a creative process. Still, there is the outline of a plan to follow.
the entire program design process can be divided into two phases, the problem-solving phase and the
implementation phase. The result of the problem-solving phase is an algorithm, expressed in English, for
solving the problem. To produce a program in a programming language such as C++, the algorithm is
translated into the programming language. Producing the final program from the algorithm is called the
implementation phase.
Many novice programmers do not understand the need to design an algorithm before writing a program in
a programming language, such as C++, and so they try to short-circuit the process by omitting the problem-
solving phase entirely, or by reducing it to just the problem-definition part. This seems reasonable. Why
not “go for the mark” and save time? The answer is that it does not save time! Experience has shown that
the two-phase process will produce a correctly working program faster. The two-phase process simplifies
the algorithm design phase by isolating it from the detailed rules of a programming language such as C++.
The result is that the algorithm design process becomes much less intricate and much less prone to error.
For even a modest-size program, it can represent the difference between a half day of careful work and
several frustrating days of looking for mistakes in a poorly understood program.