Preface
Acknowledgements
About the Autho
Chapter1 Programming Fundamentals
Lesson1.1 Programming Languages
1.1.1 Assembly Language
1.1.2 High Level Languages
Lesson1.2 Software Engineering
1.2.1 Top-down Modular Design
Lesson1.3 The C Language, ANSI C and C Compile
1.3.1 C and ANSI C
1.3.2 ProgramDevelopment
Lesson1.4 Using Bits to Represent Characte andSymbols, Intege, Real
Numbe, Addresses and Itructio
1.4.1 Characte and Symbols
1.4.2 Intege
1.4.3 Real Numbe
1.4.4 Hexadecimal and Octal Notatio
Lesson1.5 About This Textbook and How to Get The MostOut of It
1.5.1 The Lesson
1.5.2 The Application Programs
Lesson1.6 Basic Structure
Lesson1.7 Formatting Output
Lesson1.8 More Escape Sequences
Lesson1.9 Basic Debugging
Chapter Review
Chapter2 Variables, Arithmetic Expressio and Input/Output
Lesson2.1 Variables: Naming, Declaring, Assigning andPrinting Values
Lesson2.2 Arithmetic Operato and Expressio
Lesson2.3 Reading Data from the Keyboard
Lesson2.4 Cotant Macros and More About PrintingVariable Values
Lesson2.5 Mixed Type Arithmetic, Compound Assignment,Operator
Precedence and Type Casting
Chapter Review
Chapter3 The Basics of C - Math Functio and Character FileInput/Output
Lesson3.1 Math Library Functio
Lesson3.2 Single Character Data
Lesson3.3 Reading Data From a File
Lesson3.4 Writing Output To a File
Application Program3.1 Area Calculation -Compound Operato and
ProgramDevelopment
Application Exercises
Chapter Review
Chapter4 Beginning Decision Making and Looping
Lesson4.1 If Control Structure and RelationalExpressio
Lesson4.2 Simple If-Else Control Structures
Lesson4.3 Nested If-Else Control Structures
Lesson4.4 Logical Expressio
Lesson4.5 Precedence of Logical Operato
Lesson4.6 Switch and If-Else-If ControlStructures
Lesson4.7 While Loop (1)
Lesson4.8 While Loop (2)
Lesson4.9 Do-While Loops
Lesson4.10 Simple For Loop
Lesson4.11 Nested For Loops
Application Program4.1 Girder Inteection -If-Else Control Structure
Application Program4.2 Area Calculation - ForLoop
Application Program4.3 Temperature UnitConveio - For Loop
Application Program4.4 Temperature UnitConveio - Loop and If-Else
Control Structure
Application Program4.5 Simulation
Application Program4.6 EngineeringEconomics - Nested For Loops
Application Program4.7 Solving a QuadraticEquation - If-Else Control Structure
(Numerical Method Example)
Application Exercises
Chapter Review
Chapter5 Functio
Lesson5.1 Functio That Do Not Return a Value
Lesson5.2 Functio That Return Just One Value
Lesson5.3 Scope and Mechanics of Passing Values toFunctio
Lesson5.4 Functio That \Return\ More Than OneValue
Lesson5.5 Mechanics of \Returning\ More Than One Valuefrom a Function
Addresses and Pointer Variables
Application Program5.1 Using Functio WithComplex Loops and Working with Grids (a Logic Example)
Application Program5.2 ModularProgramDesign - Area of Parallelogram,
Volume of Parallelepiped (Numerical MethodExample)
Application Exercises
Chapter Review
Chapter6 Numeric Arrays
Lesson6.1 Introduction to -D Arrays and Printing ArrayElements
Lesson6.2 Array Initialisation
Lesson6.3 Basic Array Input/Output
Lesson6.4 Multidimeional Arrays
Lesson6.5 Functio and Arrays
Lesson6.6 Bubble Sort, Exchange Maximum Sort andExchange Minimum Sort*
Application Program6.1 Deriving a -bitAdder from Sixteen -Bit Adde
Application Program6.2 Mean and Median ofMeasured Wave Heights (Numerical Method Example)
Application Program6.3 Matrix-VectorMultiplication (Numerical Method Example)
Application Program6.4 Searching and FileCompression
Application Exercises
Chapter Review
Chapter7 Strings and Pointe
Lesson7.1 Declaring, Initialising and Printing Stringsand Undetanding Memory Arrangement
Lesson7.2 Determining Information About Strings andCharacte and Using Prinff
Lesson7.3 -D Character Arrays
Lesson7.4 Reading Strings from The Keyboard and Files
Lesson7.5 Pointer Variables Veus Array Variables
Lesson7.6 Initialising Within a Declaration
Lesson7.7 Passing Strings to User-DefinedFunctio
Lesson7.8 Standard Character String Functio
Lesson7.9 Pointer Notation Veus Array Notation
Lesson7.10 Dynamic Memory Allocation
ProgramDevelopment Methodology
Application Program7.1 Pipe FluidVelocity, Checking Input Data and Modular Design
Application Program7.2 EarthquakeAnecdotal Report Analysis, String
Operatio and Dynamic Storage Allocation
Application Exercises
Chapter Review
Chapter8 Structures and Large ProgramDesign
Part I: Data Structures
Structures in C
Lesson8.1 Structures
Lesson8.2 Structure Membe
Lesson8.3 Pointe to Struc~res
Lesson8.4 Structures and Functio
Lesson8.5 Arrays of Structures
Part II: Advanced Programming Techniques
Lesson8.6 Functio With One Recuive Call
Lesson8.7 Creating Header Files
Lesson8.8 Use of Multiple Source Code Files and StorageClasses
Lesson8.9 Bitwise Manipulatio
Application Program8.1 Sorting - QuicksortAlgorithm
Chapter Review
Chapter9 An Introduction to C++ (Online Chapter)
Appendix A
Appendix B
Index