Springer eBooks may be purchased by end-customers only and are sold without copy protection (DRM free). Instead, all eBooks include personalized watermarks. This means you can read the Springer eBooks across numerous devices such as Laptops, eReaders, and tablets.
You can pay for Springer eBooks with Visa, Mastercard, American Express or Paypal.
After the purchase you can directly download the eBook file or read it online in our Springer eBook Reader. Furthermore your eBook will be stored in your MySpringer account. So you can always re-download your eBooks.
1 The Purpose of This Text This text has been written in response to two trends that have gained considerable momentum over the past few years. The first is the decision by many undergraduate engineering and science departments to abandon the traditional programming course based on the aging Fortran 77 standard. This decision is not surprising, considering the more modem features found in languages such as Pascal and C. However, Pascal never developed a strong following in scientific computing, and its use is in decline. The new Fortran 90 standard defines a powerful, modem language, but this long-overdue redesign of Fortran has come too late to prevent many colleges and universities from switching to C. The acceptance of C by scientists and engineers is based perhaps as. much on their perceptions of C as an important language, which it certainly is, and on C programming experience as a highly marketable skill, as it is on the suitability of C for scientific computation. For whatever reason, C or its derivative C++ is now widely taught as the first and often only programming language for undergraduates in science and engineering. The second trend is the evolving nature of the undergraduate engineering curriculum. At a growing number of institutions, the traditional approach of stressing theory and mathematics fundamentals in the early undergraduate years, and postponing real engineering applications until later in the curriculum, has been turned upside down.
Content Level »Lower undergraduate
Keywords »C programming language - FORTRAN - algorithm - algorithms - data structure - data structures - programming - programming language - selection
1 Programming Preliminaries.- 1.1 A Five-Step Problem-Solving Process.- 1.1.1 Step 1: Define the Problem.- 1.1.2 Step 2: Outline a Solution.- 1.1.3 Step 3: Design an Algorithm.- 1.1.4 Step 4: Convert the Algorithm Into a Program.- 1.1.5 Step 5: Verify the Operation of the Program.- 1.2 Defining a Pseudocode Language for Algorithm Development.- 1.3 Organizing Pseudocode Into a Program.- 1.4 Examples.- 1.5 What Is the Point of Programming?.- 1.6 Your First C Program.- 2 The Basics of C Programming.- 2.1 C Program Layout.- 2.2 Basic Input and Output.- 2.2.1 Keyboard Input and Monitor Output.- Reading and Displaying Numbers.- Reading and Displaying Characters and Strings of Characters.- Reading Values With Leading Zeros and Nonblank Separators.- 2.2.2 File I/O.- 2.2.3 I/O Redirection.- 2.3 Reading External Text Files of Unknown Length.- 2.4 Reading a File One Character at a Time.- 2.5 Applications.- 2.5.1 Maximum Deflection of a Beam Under Load.- 2.5.2 Relativistic Mass and Speed of an Electron.- 2.6 Debugging Your Programs.- 2.6.1 Compile-Time Errors.- 2.6.2 Run-Time Errors.- 2.7 Exercises.- 3 Data Types, Operators, and Functions.- 3.1 Specifying and Using Data Types.- 3.2 Operators.- 3.3 Type Casting.- 3.4 Intrinsic Functions.- 3.5 Simple User-Defined Functions.- 3.6 Applications.- 3.6.1 Refraction of Light.- 3.6.2 Inverse Hyperbolic Functions.- 3.7 Debugging Your Programs.- 3.7.1 Problems With Data Types and Casting.- 3.7.2 Problems With Intrinsic Functions.- 3.7.3 Problems With User-Defined Functions.- 3.8 Exercises.- 4 Selection and Repetition Constructs.- 4.1 Relational and Logical Operators.- 4.2 Selection (IF…THEN…ELSE…) Constructs.- 4.3 Choosing Alternatives From a List of Possibilities.- 4.4 Repetition (LOOP…) Constructs.- 4.4.1 Count-Controlled Loops.- 4.4.2 Conditional Loops.- Pre-Test Loops.- Post-Test Loops.- Loops for Input Validation.- 4.5 Applications.- 4.5.1 Solving the Quadratic Equation.- 4.5.2 Maximum Deflection of a Beam With Various Support/Loading Systems.- 4.5.3 Refraction of Light.- 4.5.4 Oscillating Frequency of an LC Circuit.- 4.5.5 Calculating Radiation Exposures for a Materials Testing Experiment.- 4.6 Debugging Your Programs.- 4.7 Exercises.- 5 More About Modular Programming.- 5.1 Defining Information Interfaces in C.- 5.2 Menu-Driven Programs.- 5.3 More About Function Interfaces.- 5.4 Recursive Functions.- 5.5 Using Prewritten Code Modules.- 5.6 Using Functions as Arguments and Parameters.- 5.7 Passing Arguments to the main Function.- 5.8 Applications.- 5.8.1 The Quadratic Equation Revisited.- 5.8.2 Finding Prime Numbers.- 5.8.3 The Towers of Hanoi.- 5.8.4 Trapezoidal Rule Integration.- 5.9 Debugging Your Programs.- 5.9.1 Passing Multiple Outputs Through Parameter Lists.- 5.9.2 Recursive Functions.- 5.9.3 Reusable Code.- 5.10 Exercises.- 6 Arrays.- 6.1 Arrays in Structured Programming.- 6.2 One-Dimensional Array Implementation in C.- 6.3 Using Arrays in Function Calls.- 6.4 Multidimensional Arrays.- 6.5 Accessing Arrays With Pointers.- 6.6 More About Strings.- 6.6.1 Strings as Arrays.- 6.6.2 String Functions.- 6.7 Applications.- 6.7.1 Cellular Automata and Sierpinski Triangles.- 6.7.2 Probability Analysis for Quality Control of Manufacturing Processes.- 6.7.3 Parsing a String Containing an Unknown Number of Numerical Values.- 6.8 Debugging Your Programs.- 6.9 Exercises.- 7 User-Defined Data Objects.- 7.1 Creating User-Defined Data Objects.- 7.2 Arrays of Structures.- 7.3 Functions With Structures as Parameters and Data Types.- 7.4 Applications.- 7.4.1 Finding the Perimeter and Area of a Plot of Land.- 7.4.2 A Set of Functions to Perform Operations on Complex Numbers.- 7.4.3 Analyzing Data From a Datalogger.- 7.5 Debugging Your Programs.- 7.6 Exercises.- 8 Searching and Sorting Algorithms.- 8.1 Introduction.- 8.2 Searching Algorithms.- 8.2.1 Linear Searches.- 8.2.2 Binary Search.- 8.2.3 Choosing a Searching Algorithm.- 8.3 Sorting Algorithms.- 8.3.1 Selection Sort.- 8.3.2 Insertion Sort.- 8.3.3 The Recursive Quicksort Algorithm.- 8.3.4 Efficiency of Sorting Algorithms.- 8.5 Application: Merging Sorted Lists.- 8.6 Debugging Your Programs.- 8.7 Exercises.- 9 Basic Statistics and Numerical Analysis.- 9.1 Introduction.- 9.2 Basic Descriptive Statistics.- 9.2.1 The Sample Mean and Standard Deviation.- 9.2.2 Linear Regression and the Linear Correlation Coefficient.- 9.2.3 Application: Analyzing Wind Speed Data.- 9.3 Numerical Differentiation.- 9.3.1 Newton’s and Stirling’s Formulas.- 9.3.2 Application: Estimating the Speed of a Falling Object.- 9.4 Numerical Integration.- 9.4.1 Polynomial Approximation Methods.- 9.4.2 Application: Evaluating the Gamma Function.- 9.5 Solving Systems of Linear Equations.- 9.5.1 Linear Equations and Gaussian Elimination.- 9.5.2 Application: Current Flow in a DC Circuit With Multiple Resistive Branches.- 9.6 Finding the Roots of Equations.- 9.7 Numerical Solutions to Differential Equations.- 9.7.1 Motion of a Damped Mass and Spring.- 9.7.2 Application: Current Flow in a Series LRC Circuit.- 9.8 Exercises.- 10 Binary Files, Random Access, and Dynamic Allocation.- 10.1 Binary and Random Access Files.- 10.1.1 Random Access File Concepts.- 10.1.2 Implementing Binary Files.- File Access Modes.- I/O for Binary Files.- Random Access to Binary Files.- 10.2 Dynamic Allocation and Linked Lists.- 10.2.1 The Concept of Dynamic Allocation.- 10.2.2 Dynamically Allocated Arrays.- 10.2.3 Dynamically Allocated Linked Lists.- Data Declarations.- Function Prototypes.- Function main.- Creating the List.- Accessing Nodes in the List.- Adding and Deleting Nodes.- 10.3 Queues and Stacks.- 10.3.1 Implementing Queues.- 10.3.2 Implementing Stacks.- 10.4 Application: Managing Data From Remote Instruments.- 10.5 Exercises.- Appendices.- Appendix 1: Table of ASCII Characters for Windows/DOS-Based PCs.- Appendix 2: Program Listings by Chapter.- Appendix 3: Glossary.