Introduction to programming with C++ - Zak, Diane; Zak, Diane (Boston, Massachusetts : Cengage Learning Asia Pte Ltd, 2011)
From the Publisher: An Introduction to Programming with C++, Sixth Edition is the latest C++ offering from Diane Zak. This book is distinct from other textbooks because of its unique approach, which motivates students by demonstrating why they need to learn the concepts and skills presented. Each chapter contains Mini-Quizzes, Labs, and Try This features to help readers practice and absorb the content as they go along. This edition also includes completely new applications and exercises, more IPO charts and flowcharts, and a brand new interior design.
Preface -- 1: Introduction To Programming -- Programming a computer -- Programmer's job -- Do I have what it takes to be a programmer? -- Employment opportunities -- Brief history of programming languages -- Machine languages -- Assembly languages -- High-level languages -- Control structure -- Sequence structure -- Selection structure -- Repetition structure -- Summary -- Key terms -- Review questions -- Exercises -- 2: Beginning The Problem-Solving Process -- Problem solving -- Solving everyday problems -- Creating computer solutions to problems -- Step 1-Analyze the problem -- Step 2-Plan the algorithm -- Step 3-Desk-check the algorithm -- Gas mileage problem -- Summary -- Key terms -- Review questions -- Exercises -- 3: Variables And Constants -- Beginning step 4 in the problem-solving process -- Internal memory -- Selecting a name for a memory location -- Revisiting the Treyson Mobley problem -- Selecting a data type for a memory location -- How data is stored in internal memory -- Selecting an initial value for a memory location -- Declaring a memory location -- Summary -- Key terms -- Review questions -- Exercises -- 4: Completing The Problem-Solving Process -- Finishing step 4 in the problem-solving process -- Getting data from the keyboard -- Displaying messages on the computer screen -- Arithmetic operators in C++ -- Type conversions in arithmetic expressions -- Static_cast operator -- Assignment statements -- Step 5-Desk check the program -- Step 6-Evaluate and modify the program -- Arithmetic assignment operators -- Summary -- Key terms -- Review questions -- Exercises -- 5: Selection Structure -- Making decisions -- Flowcharting a selection structure -- Coding a selection structure in C++ -- Comparison operators -- Swapping numeric values -- Displaying the sum or difference -- Logical operators -- Using the truth tables -- Calculating gross pay -- Pass/fail program -- Converting a character to uppercase or lowercase -- Formatting numeric output -- Summary -- Key terms -- Review questions -- Exercises -- 6: More On The Selection Structure -- Making decisions -- Flowcharting a nested selection structure -- Coding a nested selection structure -- Logic errors in selection structures -- First logic error: Using a compound condition rather than a nested selection structure -- Second logic error: Reversing the outer and nested decisions -- Third logic error: Using an unnecessary nested selection structure -- Multiple-alternative selection structures -- Switch statement -- Summary -- Key terms -- Review questions -- Exercises -- 7: Repetition Structure -- Repeating program instructions -- Using a pretest loop to solve a real-world problem -- Flowcharting a pretest loop -- While statement -- Using counters and accumulators -- Sales express program -- Counter-controlled pretest loops -- For statement -- Holmes supply program -- Colfax sales program -- Another version of the Miller Incorporated program -- Summary -- Key terms -- Review questions -- Exercises. 8: More On The Repetition Structure -- Posttest loops -- Flowcharting a posttest loop -- Do while statement -- Nest repetition structures -- Asterisks program -- Savings calculator program -- Pow function -- Coding the savings calculator program -- Modifying the savings calculator program -- Summary -- Key terms -- Review questions -- Exercises -- 9: Value-Returning Functions -- Functions -- Hypotenuse program -- Finding the square root of a number -- Random addition problems program -- Generating random integers -- Creating program-defined value-returning functions -- Calling a function -- Function prototypes -- Plano Elementary School program -- Area calculator program -- Scope and lifetime of a variable -- Bonus calculator program -- Summary -- Key terms -- Review questions -- Exercises -- 10: Void Functions -- Void functions -- Passing variables to a function -- Reviewing passing variables by value -- Passing variables by reference -- Salary program -- Summary -- Key terms -- Review questions -- Exercises -- 11: One-Dimensional Arrays -- Arrays -- One-dimensional arrays -- Declaring and initializing a one-dimensional array -- Entering data into a one-dimensional array -- Displaying the contents of a one-dimensional array -- Coding the XYZ company's sales program -- Passing a one-dimensional array to a function -- Moonbucks Coffee program-calculating a total and average -- KL Motors program-searching an array -- Hourly rate program-accessing an individual element -- Random numbers program -- Sorting the data stored in a one-dimensional array -- Parallel one-dimensional arrays -- Summary -- Key terms -- Review questions -- Exercises -- 12: Two-Dimensional Arrays -- Using two-dimensional arrays -- Declaring and initializing a two-dimensional array -- Entering data into a two-dimensional array -- Displaying the contents of two-dimensional array -- Coding the Caldwell Company's orders program -- Accumulating the values stored in a two-dimensional array -- Searching a two-dimensional array -- Passing a two-dimensional array to a function -- Summary -- Key term -- Review questions -- Exercises -- 13: Strings -- String data type -- Creative sales program -- Getline function -- Ignore function -- ZIP code program -- Determining the number of characters contained in a string variable -- Accessing the characters contained in a string variable -- Rearranged name program -- Searching the contents of a string variable -- Annual income program -- Removing characters from a string variable -- Replacing characters in a string variable -- Social Security number program -- Inserting characters within a string variable -- Company name program -- Duplicating a character within a string variable -- Concatenating strings -- Summary -- Key terms -- Review questions -- Exercises -- 14: Sequential Access Files -- File types -- CD collection program -- Creating file objects -- Opening a sequential access file -- Determining whether a file was opened successfully -- Writing data to a sequential access file -- Reading information from a sequential access file -- Testing for the end of a sequential access file -- Closing a sequential access file -- Coding the CD collection program -- Summary -- Key terms -- Review questions -- Exercises -- Appendix A: Answers to Mini-Quizzes and Labs -- Appendix B: C++ Keywords -- Appendix C: ASCII Codes -- Appendix D: How to use Microsoft Visual C++ -- Appendix E: How to use Dev-C++ -- Appendix F: Classes and objects -- Object-oriented terminology -- Defining a class in C++ -- Instantiating an object and referring to a public member -- Example 1-Class that contains public data members only -- Header files -- Example 2-Class that contains a private data member and public member methods -- Example 3-Using a class that contains two constructors -- Example 4-Class that contains overloaded methods -- Summary -- Key terms -- Review questions -- Exercises -- Index.
Includes bibliographical references and index.
Keywords: C++ (COMPUTER PROGRAM LANGUAGE)