Вы находитесь на странице: 1из 4

Program Development Life-Cycle

The five steps of the program development cycle are:

1. Problem Specification 2. Understanding the problem 3. Design an Algorithm 4. Implementation 5. Testing and Debugging.

PROBLEM SPECIFICATION

Problems usually come poorly specified in the real world - the person who wants the computer to do some task is often unaware of exactly what it is he or she wants the computer to do. The potential users & the programmers must agree on the problem specifications.

At this step: The problem should be clearly specified. The unimportant aspects should be eliminated and focus should be placed on the root of the problem. The user must be satisfied that the specification will solve the problem. The programmer must be satisfied that the specifications fully and completely specify the problem (that can be solved with the given resources in the given time.)

UNDERSTANDING THE PROBLEM

This is an essential step but is often overlooked by many. In order to clearly understand the given problem one should read and reread the problem statement.

At this step you should determine: What are your INPUTS (what data was given to you). What are your OUTPUTS (what are the results). How am I going to get the desired results?

NOTE: Failure to understand the problem will mean certain failure in the steps that follow.

DESIGNING AN ALGORITHM

Algorithm a precise set of instructions that solves a problem in a finite number of steps.

As we now understand the problem our focus now shifts to designing a plan for its solution. The plan should be written in pseudo-code (English language instructions) so that our attention is on algorithm design rather than the syntax of the programming language.

At this step: We can use a design strategy known as Top-down Design in order to develop the algorithm. o Top-down design uses the divide and conquer strategy to break up the problem into manageable pieces. o The pieces are further subdivided, if necessary. (The continued subdivision is called stepwise refinement.) o The entire problem can be solved by solving the subdivisions.

At the end of this step we should have a series of instructions (written in English) that will solve the problem. At this point you should trace through the algorithm with some test data to ensure that it is producing the right results.

NOTE: Emphasis is placed on the logic of the algorithm.

IMPLEMENTATION

Many individuals tend to start at this step, without a real understanding of what they are trying to implement: - this usually leads to a lot of frustration.

At this step: The pseudo-code algorithm developed in step 3 is translated into the programming language being used. Emphasis is placed on the syntax of the language and producing a program free of syntax errors.

NOTE: Producing a program free of syntax errors does not mean that it produces the correct output.

TESTING AND DEBUGGING

Once the program has been coded it has to be tested to ensure it produces the correct result.

At this step: Test the program with several set of data. Debug the program If wrong results are produced you have to find and fix the error(s).

Testing Algorithms

Algorithm for finding the area of a circle whose radius is 3.

Begin r=3 pi = 22 /7 a = pi * r * 2 print (a) End

Step 1: Calculate the area of the circle using the formula r2. area = 3.142 x 3 x 3 = 28.3

Step 2: Run the algorithm with the actual values in the variables and determine what will be printed.

r = 3, pi = 22/7 a = 22/7 * 3 * 2 = 18.6 print (18.6)

Step 3: Determine if the algorithm produced the correct output by comparing the answers from steps 1 & 2. If they are the same then the logic in the algorithm is correct. o Convert the algorithm to a programming language.

If they are NOT the same then there is an error in the algorithm. o o Find and fix error. Re-test algorithm.

Вам также может понравиться