This book presents introductory programming and software development concepts to engineers using a disciplined approach. It provides numerous case studies and programming projects based on real-world examples from a wide range of engineering areas, making the material relevant to what engineers will encounter in their careers; the authors introduce implementations of basic numerical and statistical methods commonly used by engineers. Another feature is the addition of a chapter entitled "On to C++" that prepares readers for a transition to object-oriented programming. KEY TOPICS: The book focuses on many aspects of software engineering, establishing early the connection between good problem-solving skills and effective software development. A five-phase software development method is presented in Chapter 1 and applied in every subsequent case study throughout. The book presents material in an order that meets the needs of a beginning programmer, rather than by the structure of the C programming language. This approach makes it possible to present fundamental concepts using traditional high-level terminology--output parameter, array, array subscript, string--and makes it easier for readers without a prior assembly-language background to master the many facets of pointer usage. MARKET: This book is designed to introduce C programming to engineers in a way that is relevant to their engineering practice.
(Each Chapter concludes with "Common Programming Errors" and a "Chapter Review.")
1. Overview of Computers and Software.
Computing for Engineers.
The Software Development Method.
Applying the Software Development Method.
Case Study: Converting Miles to Kilometers.
C Language Elements.
Variable Declarations and Data Types.
General Form of a C Programs.
Case Study: Finding the Area and Circumference of a Circle.
Formatting Numbers in Program Output.
Interactive Mode, Batch Mode, and Data Files.
Representation of Data Types.
Extending a Problem Solution.
Case Study: Quality Control in Manufacturing Flat Washers.
Functions Implementing Additional Operators.
Simple User-Defined Functions
The if Statement.
if Statements with Compound Statements.
Nested if Statements and Multiple-Alternative Decisions.
Decision Steps in Algorithms.
Case Study: Computing Compass Bearings.
The switch Statement.
Repetition in Programs: Using Loops to Solve Problems.
Counting Loops and the while Statement.
Computing a Sum or a Product in a Loop.
The for Statement.
Nested Control Structures.
The do-while Statement and Flag-Controlled Loops.
Problem Solving Illustrated.
Case Study: Computing Radiation Levels.
How to Debug and Test Programs.
Functions with Input Arguments.
Problem Solving with Top-Down Design.
Case Study: Finding Prime Numbers.
Functions Output Parameters Implemented with Pointers.
Introduction to Scope of Names.
Formal Output Parameters as Actual Arguments.
Case Study: Bisection Method for Finding Roots.
Top-Down Design Illustrated.
Case Study: Performing Arithmetic Operations on Common Fractions.
Debugging and Testing a Program System.
Declaring and Referencing Arrays.
Using for Loops for Sequential Access.
Using Array Elements as Function Arguments.
Using Character Arrays as Strings.
Array Processing Illustrated.
Case Study: Finding Palindromes in Nucleotide Sequences.
Dynamic Allocation of Arrays.
Declaring and Referencing Multidimensional Arrays.
Modeling with Two-Dimensional Arrays.
Case Study: Cellular Telephone System.
Vectors and Matrices.
Solving Systems of Linear Equations.
User-Defined Structure Types.
Structure Type Data as Input and Output Parameters.
Functions Whose Result Values Are Structured.
Problem Solving with Structure Types.
Case Study: A User-Defined Type for Complex Numbers.
Parallel Arrays and Arrays of Structures.
Case Study: Universal Measurement Conversion.
Input/Output Files: Review and Further Study.
Searching a Database.
Case Study: Metals Database Inquiry.
Using Abstraction to Manage Complexity.
Personal Libraries: Header Files.
Personal Libraries: Implementation Files.
Modifying Functions for Inclusion in a Library.
Arguments to Function main.
Defining Macros with Parameters.
Finding Roots of Equations.
Solving First-Order Differential Equations.
Commercial Numerical Methods Software.
C++ Control Structures, Input/Output, and Functions.
C++ Support for Object-Oriented Programming.
A. Character Sets
B. ANSI C Standard Libraries.
C. C Operators.
D. C Numeric Types.
E. Enumerated Types.
F. Pointer Arithmetic.
G. Dynamic Allocation of Two-Dimensional Arrays.
H. ANSI C Reserved Words.