CS 1704 - Summer II 2003

Structure Charts


The first thing to do when making a structure chart is to break your program down into subparts (functions).  For example, the following picture is an example of how to make an Italian Dinner...each activity (function) is subdivided into sub-activities (functions).  For the example below, the following psudocode would implement the structure:

main () { //Automatic Teller

Activate_Customers_Records();
Get_Valid_Fuction_Request();
Handle_Transactions(); 

}

Activate_Customers_Records() {

Validate_Customer();
Pull_Customers_Record();
Pull_Customers_Record();

}

Validate_Customer() {

Get_Valid_Card_Num();
Get_Valid_Code_Num();

}

etc.....so each line is representing a function call....now, notice I called the function Pull_Custormers_Record() twice...this is NOT represented.  Only the first call to a function from within a function is represented (except in cases I'm not going to worry about).

The second thing to do look at the parameters and return values that are being passed. For example, the following picture could represent the following code:

int main () { //Monitor Patient

    int factors=Obtain_Factors();
    int unsafe_factors=Detect_Out_Of_Range_Factors(factors);
    int patient_number=5;
    Notify_Medical_Personnel(patient_number,unsafe_factors);

}

The next thing to do is look at the put in system calls. Notice that the following model assumes that screen or file input and output are calls to predefined includes.  It also shows that some parameters are passed both ways.

Finally, whether or not a parameter is data or a control must be noted. 

Not shown on these examples, but as important, is the condition by which the function was called.  For example, if the function is called from within an if statement or while loop, such must be shown using the diamond or diamond w/ arrow.

Let me know if there is something more I can post.