21.08.2013 Views

Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

126 Chapter 10 ■ Data structure design<br />

To sum up, the steps we have taken are:<br />

1. draw a diagram showing the structure of the file<br />

2. derive the corresponding program structure diagram<br />

3. write down the elementary operations that the program will have to carry out<br />

4. place the operations on the program structure diagram<br />

5. derive the pseudo-code of the program.<br />

SELF-TEST QUESTION<br />

10.1 Check that operation 9 (new line) has been placed in all the right<br />

places on the program structure diagram.<br />

10.3 ● Processing input files<br />

To understand how to input and process in<strong>for</strong>mation from a file, consider the following<br />

problem:<br />

A serial file consists of records. Each record describes a person. Design a program to<br />

count the number of males and the number of females.<br />

The data structure diagram is given in Figure 10.7.<br />

The new notation here is the boxes with the letter “o” in them (meaning or) to<br />

indicate alternatives. These boxes are drawn alongside each other. Depending on the<br />

application, there are sometimes a number of alternatives.<br />

Body<br />

Record<br />

Male Female<br />

Figure 10.7 Data structure diagram <strong>for</strong> counting males and females<br />

*<br />

File<br />

eof

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!