Section 2b

Overview of the Four Step Programming Process


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Systematic and Structured Programming

The Overview - Using Four Steps


The steps of the process are pretty straightforward. In step one, the entire program is written in no more than eight to ten English-language or pseudocode steps as comments in the main method area, as well as other areas where appropriate. Even though the whole program is written at a very high level without concern for the details – this is called abstraction – the program must be complete. That is to say, everything the program will do must be contained in the specified steps.

Step two simply takes the statements created in step one and breaks them down by placing “substep” statements under each step one statement. As was previously the case with step one, no group or block of statements should have more than eight to ten statements; the substeps should be broken down into further substep groups as needed to satisfy the requirements of that particular step. When step two is completed, the series of statements, substatements, and sub-substatements (as needed) should provide the developer with a complete step-by-step description of how the program will run. At this point, the developer should be able to "run" the program in her head or on paper, and it should correctly solve the problem.

There will always be subroutines -- known as methods in the Java programming language -- in every program you write within your course. These are the tools that support your programming process by taking care of unique parts of the program. If you will be developing methods, they must be specified (i.e., their specifications are written) and located (i.e., the location where the methods are called is identified) in step three. For this four step operation, you will not be developing your own methods, but you will still need to show the location of the methods you will be using.

In step four, the main method is implemented (i.e., the actual program code is written for the main method).

For this, your first introduction to this development process where you will not be conducting any method development, step four is the final step. The program will run without further development.

Brief Summary. Here is the nutshell explanation of each step:

  1. Write the major actions of the program in fewer than 8 to 10 steps; no code block at any level should have more than 8 to 10 steps

  2. Expand on the major actions with more specific details related to each of the major steps; the programming solution is completed in English form

  3. Identify and locate the methods necessary to solve the problem. You will find parts of your program that require the use of subroutines (i.e., methods) such as keyboard input, monitor output, and mathematical or other unique operations. You will indicate in your program exactly where they are to be used, and you will also have to identify where you get the methods from. This is easily resolved by your use of other classes (when appropriate) that will provide the "ready-made" methods for you.

  4. Using the previously developed steps, write the code for the main method; when you have done this, your program will work.

This four step process will help you develop programs in a modular way, which naturally means using methods. Later in the reference when you have begun developing your own methods, two more steps will be added. For the time being however, you will appreciate the way this process gets you through your programs.

The simple fact is that if you learn to use this structured and systematic process for your development, your programming tasks will be easier, they will take less time, and you will finish with a better quality programming product. As stated at the beginning of this topic, once this course has been completed, you don’t have to use this exact programming process. However, if you don’t have some kind of comparable programming process, you will struggle.