| ABOUT THE AUTHORS |
|
iii | (2) |
| PREFACE |
|
v | (5) |
| ACKNOWLEDGMENTS |
|
x | |
| PART 1: CONCEPTS IN MODERN ENGINEERING COMPUTATIONS |
|
1 | (38) |
|
CHAPTER 1: INTRODUCTION TO ENGINEERING COMPUTATIONS |
|
|
3 | (17) |
|
1.1 Applications of Computers in Engineering |
|
|
3 | (1) |
|
1.2 Recent Advances in Computing |
|
|
4 | (2) |
|
1.3 Computer Hardware Concepts |
|
|
6 | (2) |
|
1.4 Operating System Concepts |
|
|
8 | (1) |
|
1.5 Computer Networking Concepts |
|
|
9 | (10) |
|
|
|
19 | (1) |
|
CHAPTER 2: PRINCIPLES OF ENGINEERING SOFTWARE DEVELOPMENT |
|
|
20 | (19) |
|
2.1 Hardware-Software Life Cycle |
|
|
20 | (2) |
|
2.2 Principles of Engineering Software Design |
|
|
22 | (8) |
|
2.3 Computer Programming Language Concepts |
|
|
30 | (4) |
|
2.4 Programming Language Selection |
|
|
34 | (5) |
| PART 2: C PROGRAMMING TUTORIAL |
|
39 | (298) |
|
CHAPTER 3: GETTING STARTED |
|
|
41 | (29) |
|
|
|
41 | (1) |
|
|
|
42 | (1) |
|
3.3 Writing and Compiling a Simple C Program |
|
|
42 | (4) |
|
3.4 Program 3.1: Print Approximate Value of Pi |
|
|
46 | (6) |
|
3.5 Program 3.2: Compute and Print Area of Circle |
|
|
52 | (10) |
|
3.6 Compiling and Running Small C Programs |
|
|
62 | (4) |
|
3.7 Programming Guidelines |
|
|
66 | (1) |
|
3.8 Programming Exercises |
|
|
67 | (3) |
|
CHAPTER 4: BASIC DATA TYPES AND VARIABLES |
|
|
70 | (25) |
|
4.1 Basic Data Types in C |
|
|
70 | (1) |
|
|
|
71 | (5) |
|
|
|
76 | (2) |
|
4.4 Single and Double Precision Floating Point Numbers |
|
|
78 | (3) |
|
4.5 Enumeration Data Types |
|
|
81 | (5) |
|
4.6 Variable Attributes: Type, Address, Name, and Value |
|
|
86 | (2) |
|
4.7 Variable Naming Conventions |
|
|
88 | (3) |
|
4.8 Programming Exercises |
|
|
91 | (4) |
|
CHAPTER 5: OPERATORS AND EXPRESSIONS |
|
|
95 | (26) |
|
5.1 Arithmetic Operators and Expressions |
|
|
95 | (1) |
|
5.2 Assignment Operations |
|
|
96 | (1) |
|
5.3 Increment/Decrement Operators |
|
|
97 | (3) |
|
5.4 Arithmetic Expressions and Precedence |
|
|
100 | (7) |
|
5.5 Mixed Expressions and Data Type Conversions |
|
|
107 | (3) |
|
5.6 Bitwise Operations and Applications |
|
|
110 | (3) |
|
5.7 Subtractive Cancellation |
|
|
113 | (3) |
|
5.8 Programming Exercises |
|
|
116 | (5) |
|
CHAPTER 6: CONTROL OF FLOW |
|
|
121 | (25) |
|
|
|
121 | (1) |
|
6.2 Relational and Logical Operands |
|
|
121 | (3) |
|
|
|
124 | (9) |
|
|
|
133 | (9) |
|
6.5 Comparison of Looping Constructs |
|
|
142 | (1) |
|
6.6 Programming Exercises |
|
|
143 | (3) |
|
|
|
146 | (38) |
|
|
|
146 | (2) |
|
7.2 Functions Required in a C Program |
|
|
148 | (1) |
|
7.3 Writing User-Defined Functions |
|
|
148 | (3) |
|
7.4 Case Study Program: Quadratic Equation Solver |
|
|
151 | (11) |
|
7.5 Call-by-Value Mechanism for Function Calls |
|
|
162 | (3) |
|
7.6 Scope and Storage of Variables and Functions |
|
|
165 | (8) |
|
7.7 Packaging of Program Modules |
|
|
173 | (2) |
|
7.8 Math Library Functions |
|
|
175 | (6) |
|
7.9 Programming Exercises |
|
|
181 | (3) |
|
CHAPTER 8: ARRAYS AND POINTERS |
|
|
184 | (57) |
|
8.1 Need for Arrays and Pointers |
|
|
184 | (1) |
|
8.2 Introduction to Arrays |
|
|
185 | (3) |
|
8.3 Initializing the Contents of an Array |
|
|
188 | (2) |
|
|
|
190 | (3) |
|
8.5 Applications of One-Dimensional Arrays |
|
|
193 | (15) |
|
8.6 Multidimensional Arrays |
|
|
208 | (3) |
|
8.7 Application of Two-Dimensional Arrays |
|
|
211 | (6) |
|
|
|
217 | (1) |
|
8.9 Pointer Type, Address, Name, Value, and Indirect Value |
|
|
217 | (6) |
|
|
|
223 | (2) |
|
8.11 Relationship between Pointers and Arrays |
|
|
225 | (7) |
|
8.12 Programming Exercises |
|
|
232 | (9) |
|
|
|
241 | (25) |
|
|
|
241 | (1) |
|
9.2 Pointers as Function Arguments |
|
|
241 | (5) |
|
9.3 Arrays as Function Arguments |
|
|
246 | (6) |
|
|
|
252 | (10) |
|
9.5 Programming Exercises |
|
|
262 | (4) |
|
CHAPTER 10: DYNAMIC ALLOCATION OF MEMORY |
|
|
266 | (34) |
|
10.1 Need for Dynamic Memory Allocation |
|
|
266 | (1) |
|
10.2 Memory Allocation with malloc(), calloc(), and realloc() |
|
|
267 | (3) |
|
10.3 Deallocating Memory with free() |
|
|
270 | (1) |
|
10.4 Dynamic Allocation of Character Strings |
|
|
271 | (2) |
|
10.5 Generic Functions for Dynamic Memory Allocation |
|
|
273 | (1) |
|
10.6 A File of Miscellaneous Functions |
|
|
274 | (4) |
|
10.7 Dynamic Allocation of One-Dimensional Arrays |
|
|
278 | (5) |
|
10.8 Dynamic Allocation of Two-Dimensional Arrays |
|
|
283 | (11) |
|
10.9 Programming Exercises |
|
|
294 | (6) |
|
CHAPTER 11: THE C PREPROCESSOR |
|
|
300 | (9) |
|
11.1 Compiling Multiple File C Programs |
|
|
300 | (2) |
|
11.2 Capabilities of the C Preprocessor |
|
|
302 | (7) |
|
CHAPTER 12: INPUT AND OUTPUT |
|
|
309 | (28) |
|
|
|
309 | (1) |
|
12.2 Using print f() for Buffered Output |
|
|
310 | (6) |
|
12.3 Using scanf() for Buffered Input |
|
|
316 | (3) |
|
|
|
319 | (3) |
|
12.5 Program 12.1: Statistics of Weekly Rainfall |
|
|
322 | (4) |
|
12.6 Reading Datasets from an Input File |
|
|
326 | (2) |
|
12.7 Program 12.2: Memory Reallocation for Datasets |
|
|
328 | (6) |
|
12.8 Programming Exercises |
|
|
334 | (3) |
| PART 3: MATLAB PROGRAMMING TUTORIAL |
|
337 | (128) |
|
CHAPTER 13: INTRODUCTION TO MATLAB |
|
|
339 | (69) |
|
|
|
339 | (3) |
|
13.2 Variables and Variable Arithmetic |
|
|
342 | (9) |
|
13.3 Matrices and Matrix Arithmetic |
|
|
351 | (16) |
|
|
|
367 | (5) |
|
13.5 General-Purpose Matrix Functions |
|
|
372 | (3) |
|
13.6 Program Development with M-Files |
|
|
375 | (7) |
|
13.7 Engineering Applications |
|
|
382 | (20) |
|
13.8 Programming Exercises |
|
|
402 | (6) |
|
CHAPTER 14: MATLAB GRAPHICS |
|
|
408 | (22) |
|
14.1 Simple Two-Dimensional Plotting |
|
|
408 | (9) |
|
14.2 Three-Dimensional Plots |
|
|
417 | (1) |
|
14.3 Mesh and Surface Plotting |
|
|
418 | (3) |
|
|
|
421 | (2) |
|
|
|
423 | (1) |
|
14.6 Hard Copies of MATLAB Graphics |
|
|
424 | (1) |
|
14.7 Preparing MATLAB Graphics for the World Wide Web |
|
|
425 | (1) |
|
14.8 Programming Exercises |
|
|
425 | (5) |
|
CHAPTER 15: SOLUTION OF LINEAR MATRIX EQUATIONS |
|
|
430 | (35) |
|
15.1 Systems of Linear Matrix Equations |
|
|
430 | (4) |
|
15.2 Case Study Problem: Three Linear Matrix Equations |
|
|
434 | (2) |
|
15.3 Singular Systems of Matrix Equations |
|
|
436 | (1) |
|
15.4 Engineering Applications |
|
|
437 | (20) |
|
15.5 Programming Exercises |
|
|
457 | (8) |
| PART 4: JAVA PROGRAMMING TUTORIAL |
|
465 | (156) |
|
CHAPTER 16: INTRODUCTION TO JAVA |
|
|
467 | (14) |
|
16.1 Java--A Little History |
|
|
467 | (1) |
|
16.2 The "Famous" Java Buzzwords |
|
|
468 | (1) |
|
16.3 Java and the Internet |
|
|
476 | (5) |
|
CHAPTER 17: OBJECT-ORIENTED PROGRAM DESIGN |
|
|
481 | (9) |
|
17.1 Fundamental Concepts |
|
|
481 | (2) |
|
17.2 Object-Oriented Software Development |
|
|
483 | (5) |
|
17.3 Is Java Object-Oriented? |
|
|
488 | (1) |
|
|
|
489 | (1) |
|
CHAPTER 18: THE JAVA LANGUAGE |
|
|
490 | (64) |
|
|
|
490 | (2) |
|
18.2 Program 18.1: "Peace on Earth" Stand-Alone Program |
|
|
492 | (5) |
|
18.3 Program 18.2: "Peace on Earth" Java Applet Program |
|
|
497 | (4) |
|
18.4 Primitive Data Types |
|
|
501 | (1) |
|
|
|
502 | (3) |
|
|
|
505 | (1) |
|
|
|
506 | (4) |
|
|
|
510 | (11) |
|
18.9 Class Libraries and Methods |
|
|
521 | (6) |
|
|
|
527 | (2) |
|
18.11 Program 18.3: Compute Roots of Quadratic Equation |
|
|
529 | (9) |
|
18.12 Program 18.4: Point and Line Segment Operations |
|
|
538 | (10) |
|
18.13 Programming Exercises |
|
|
548 | (6) |
|
CHAPTER 19: JAVA GRAPHICS |
|
|
554 | (67) |
|
|
|
554 | (1) |
|
19.2 The Java Abstract Windowing Toolkit |
|
|
555 | (3) |
|
19.3 AWT Components and Containers |
|
|
558 | (4) |
|
|
|
562 | (7) |
|
|
|
569 | (2) |
|
|
|
571 | (9) |
|
|
|
580 | (10) |
|
19.8 Engineering Applications |
|
|
590 | (24) |
|
19.9 Programming Exercises |
|
|
614 | (7) |
| APPENDIX 1: INTRODUCTION TO UNIX |
|
621 | (8) |
| APPENDIX 2: THE STANDARD LIBRARY |
|
629 | (20) |
| REFERENCES |
|
649 | (2) |
| INDEX |
|
651 | |