CS210 LAB 2
Sample Solution
Stepwise Refinement
 
 Refinements
Notes
Process one book 
   Process Details
const int MAX_ELEMENTS = 200

char Title[MAX_ELEMENTS] 
char Author[MAX_ELEMENTS] 
char Publisher[MAX_ELEMENTS]

 Process Details 
    Process Title 
    Process Author 
    Process Publisher 
 

like Process Title 
like Process Title 

 Process Title 
    Request user input 
    Read Details 
    Write Details
Request User Input 
    while current char <> terminator do
             read a chracter
terminator '/'
cout << "Enter Title: "<< endl; 
cin >> title[i]; 
 
Write Details 
     while current char <> terminator do
             write a chracter

  cout << title[i];
 

You may have a different sequence for the refinement. This is one example of a refinement which shows a good decomposition of the steps for the program. The notes column need not contain a lot of detail. Refinement need not include pseudocode for all steps.