Monday, February 15, 2016

Understanding the Program Development Cycle

A programmer’s job involves writing instructions (such as those in the doubling program in the preceding section), but a professional programmer usually does not just sit down at a computer keyboard and start typing. Figure 1-1 illustrates the program development cycle, which can be broken down into at least seven steps:

1. Understand the problem.

2. Plan the logic.

3. Code the program.

4. Use software (a compiler or interpreter) to translate the program into machine language.

5. Test the program.

6. Put the program into production.

7. Maintain the program.

Understanding Simple Program Logic

Understanding Simple Program Logic

A program with syntax errors cannot be fully translated and cannot execute. A program with no syntax errors is translatable and can execute, but it still might contain logical errors and produce incorrect output as a result.

 For a program to work properly, you must develop correct logic; that is, you must write program instructions in a specific sequence, you must not leave any instructions out, and you must not add extraneous instructions. Suppose you instruct someone to make a cake as follows:

Get a bowl
Stir
Add two eggs
Add a gallon of gasoline
Bake at 350 degrees for 45 minutes
Add three cups of flour