| Preface |
|
xi | |
| 1 Program design |
|
|
Describes the steps in the program development process, and introduces current program design methodologies, procedural and object-oriented programming, algorithms, pseudocoele and program data. |
|
|
|
1.1 Steps in program development |
|
|
2 | (2) |
|
1.2 Program design methodology |
|
|
4 | (1) |
|
1.3 Procedural versus object-oriented programming |
|
|
5 | (1) |
|
1.4 An introduction to algorithms and pseudocoele |
|
|
6 | (1) |
|
|
|
7 | (3) |
|
|
|
10 | (2) |
| 2 Pseudocoele |
|
|
Introduces common words, keywords and meaningful names when writing pseudocoele. The Structure Theorem is introduced, and the three basic control structures are established. Pseudocode is used to represent each control structure. |
|
|
|
2.1 How to write pseudocoele |
|
|
12 | (3) |
|
|
|
15 | (1) |
|
2.3 The Structure Theorem |
|
|
15 | (2) |
|
|
|
17 | (2) |
| 3 Developing an algorithm |
|
|
Introduces methods of analysing a problem and developing a solution. Simple algorithms that use the sequence control structure are developed, and methods of manually checking the algorithm are determined. |
|
|
|
|
|
19 | (4) |
|
3.2 Designing a solution algorithm |
|
|
23 | (2) |
|
3.3 Checking the solution algorithm |
|
|
25 | (8) |
|
|
|
33 | (1) |
|
|
|
33 | (3) |
| 4 Selection control structures |
|
|
Expands the selection control structure by introducing multiple selection, nested selection and the case construct in pseudocoele. Several algorithms, using variations of the select/on control structure, are developed. |
|
|
|
4.1 The selection control structure |
|
|
36 | (4) |
|
4.2 Algorithms using selection |
|
|
40 | (7) |
|
|
|
47 | (4) |
|
|
|
51 | (1) |
|
|
|
51 | (4) |
| 5 Repetition control structures |
|
|
Develops algorithms that use the repetition control structure in the form of DOWHILE, REPEAT... UNTIL, and counted repetition loops. |
|
|
|
5.1 Repetition using the DOWHILE structure |
|
|
55 | (9) |
|
5.2 Repetition using the REPEAT...UNTIL structure |
|
|
64 | (3) |
|
|
|
67 | (2) |
|
|
|
69 | (1) |
|
|
|
70 | (3) |
| 6 Pseudocoele algorithms using sequence, selection and repetition |
|
|
Develops algorithms to solve eight simple programming problems using combinations of sequence, selection and repetition constructs. Each problem is properly defined; the control structures required are established; a pseudocoele algorithm is developed; and the solution is manually checked for logic errors. |
|
|
|
6.1 Eight solution algorithms |
|
|
73 | (11) |
|
|
|
84 | (1) |
|
|
|
85 | (3) |
| 7 Array processing |
|
|
Introduces arrays, operations on arrays, and algorithms that manipulate arrays. Algorithms for single and two-dimensional arrays, which initialise the elements of an array, search an array and write out the contents of an array, are presented. |
|
|
|
|
|
88 | (3) |
|
7.2 Initialising the elements of an array |
|
|
91 | (3) |
|
|
|
94 | (2) |
|
7.4 Writing out the contents of an array |
|
|
96 | (1) |
|
7.5 Programming examples using arrays |
|
|
97 | (4) |
|
7.6 Two-dimensional arrays |
|
|
101 | (4) |
|
|
|
105 | (1) |
|
|
|
105 | (5) |
| 8 First steps in modularisation |
|
|
Introduces modularisation as a means of dividing a problem into subtasks. Hierarchy charts and parameter passing are introduced, and several algorithms that use a modular structure are developed. |
|
|
|
|
|
110 | (3) |
|
8.2 Hierarchy charts or structure charts |
|
|
113 | (2) |
|
8.3 Further modularisation |
|
|
115 | (1) |
|
8.4 Communication between modules |
|
|
116 | (4) |
|
8.5 Using parameters in program design |
|
|
120 | (4) |
|
8.6 Steps in modularisation |
|
|
124 | (1) |
|
8.7 Programming examples using modules |
|
|
124 | (8) |
|
|
|
132 | (1) |
|
|
|
133 | (4) |
| 9 Further modularisation, cohesion and coupling |
|
|
Develops modularisation further, using a more complex problem. Module cohesion and coupling are introduced, several levels of cohesion and coupling are described, and pseudocode examples of each level are provided. |
|
|
|
9.1 Steps in modularisation |
|
|
137 | (6) |
|
|
|
143 | (6) |
|
|
|
149 | (5) |
|
|
|
154 | (1) |
|
|
|
154 | (7) |
| 10 General algorithms for common business problems |
|
|
Develops a general pseudocode algorithm for four common business applications. All problems are defined; a hierarchy chart is established; and a pseudocode algorithm is developed, using a mainline and several subordinate modules. The topics covered include report generation with page break, a single-level control break, a multiple-level control break and a sequential file update program. |
|
|
|
|
|
161 | (1) |
|
10.2 Report generation with page break |
|
|
162 | (2) |
|
10.3 Single-level control break |
|
|
164 | (4) |
|
10.4 Multiple-level control break |
|
|
168 | (5) |
|
10.5 Sequential file update |
|
|
173 | (6) |
|
|
|
179 | (1) |
|
|
|
180 | (8) |
| 11 Detailed object-oriented design |
|
|
Introduces object-oriented design, classes and objects, attributes, responsibilities, operations, accessors and mutators, and information hiding. The steps required to create an object-oriented solution to a problem are provided and solution algorithms developed. |
|
|
|
11.1 Introduction to object-oriented design |
|
|
188 | (5) |
|
11.2 Steps in creating an object-oriented solution |
|
|
193 | (10) |
|
11.3 Programming example using object-oriented design |
|
|
203 | (4) |
|
11.4 Interface and GUI objects |
|
|
207 | (3) |
|
|
|
210 | (1) |
|
|
|
210 | (3) |
| 12 Simple object-oriented design for multiple classes |
|
|
Introduces the concept of multiple classes, relationships between classes and polymorphism in object-oriented design. Discusses the relationship between classes, including aggregation, composition and generalisation, and lists the steps required to create an object-oriented design to a problem with multiple classes. |
|
|
|
12.1 Object-oriented design with multiple classes |
|
|
213 | (4) |
|
12.2 Programming example with multiple classes |
|
|
217 | (15) |
|
|
|
232 | (1) |
|
|
|
233 | (2) |
| 13 Conclusion |
|
|
A revision of the steps involved in good top-down program design. |
|
|
|
13.1 Simple program design |
|
|
235 | (1) |
|
|
|
236 | (3) |
| Appendix 1 Flowcharts |
|
|
Introduces flowcharts for those students who prefer a more graphic approach to program design. Algorithms that use a combination of sequence, selection and repetition are developed in some detail. |
|
|
|
The three basic control structures |
|
|
239 | (3) |
|
Simple algorithms that use the sequence control structure |
|
|
242 | (4) |
|
Flowcharts and the selection control structure |
|
|
246 | (2) |
|
Simple algorithms that use the selection control structure |
|
|
248 | (6) |
|
The case structure expressed as a flowchart |
|
|
254 | (2) |
|
Flowcharts and the repetition control structure |
|
|
256 | (1) |
|
Simple algorithms that use the repetition control structure |
|
|
257 | (8) |
|
Further examples using flowcharts |
|
|
265 | (24) |
|
|
|
289 | (14) |
| Appendix 2 Nassi-Schneiderman diagrams |
|
|
Introduces Nass/-Schneiderman diagrams for those students who prefer a more diagrammatic approach to program design. Algorithms that use a combination of sequence, selection and repetition constructs are developed in some detail. |
|
|
|
The three basic control structures |
|
|
303 | (2) |
|
Simple algorithms that use the sequence control structure |
|
|
305 | (2) |
|
N-S diagrams and the selection control structure |
|
|
307 | (2) |
|
Simple algorithms that use the selection control structure |
|
|
309 | (4) |
|
The case structure expressed as an N-S diagram |
|
|
313 | (1) |
|
N-S diagrams and the repetition control structure |
|
|
314 | (1) |
|
Simple algorithms that use the repetition control structure |
|
|
315 | (6) |
| Appendix 3 Special algorithms |
|
|
Contains a number of algorithms that are not included in the body of the textbook and yet may be required at some time in a programmer's career. |
|
|
|
|
|
321 | (3) |
|
|
|
324 | (5) |
| Appendix 4 Translating pseudocoele into computer languages: quick reference chart |
|
329 | (7) |
| Glossary |
|
336 | (7) |
| Index |
|
343 | |