CS 20

Problem
Solving

 
CS 20 Home
Problem Solving Index
 
Problem Solving Theory
Problem Solving Exercises
Problem Solving Resources
Structured Programming Rules
 Theory page 3
updated 01-Apr-2005
   
 
  back next  
 
 

   The beauty of structured programming is that the rules are a simple addition to basic rules of flowcharting. As long as the rules are followed, translating any flowchart to computer code becomes much simpler and clearer to understand.

  1. Everything starts with the basic Start -> Process -> End chart;simplest chart
  2. You may add any structure (sequence, branch, or loop) before or after any other structure.
  3. Wherever you have a process box, you may substitute it with any type of proper structure.
  4. Wherever you have a process box, you may add any structure directly before or after it.

examples:

flowcharting example

Golden Rule of Structured Programming
Each Structure has only one flow in one flow out

 

 
 
  back next