VST.Epub.contentReady(window, document); VST.cfiBase='/4';
Problem Solving with C++
Tenth Edition
VST.Epub.contentReady(window, document); VST.cfiBase='/4';
Problem Solving with C++
Tenth Edition
Walter J. Savitch
University of California, San Diego
Contributor
Kenrick Mock
University of Alaska, Anchorage
330 Hudson Street, New York, NY 10013
VST.Epub.contentReady(window, document); VST.cfiBase='/4';
Senior Vice President Courseware Portfolio Management: | Marcia J. Horton |
Director, Portfolio Management: Engineering, Computer Science & Global Editions: | Julian Partridge |
Portfolio Manager: | Matt Goldstein |
Portfolio Management Assistant: | Kristy Alaura |
Field Marketing Manager: | Demetrius Hall |
Product Marketing Manager: | Yvonne Vannatta |
Managing Producer, ECS and Math: | Scott Disanno |
Content Producer: | Sandra L. Rodriguez |
Composition: | iEnergizer Aptara, Ltd. |
Cover Designer: | Joyce Wells |
Cover Photo: | kavram/Shutterstock |
Copyright 2018, 2015, 2012, 2009, 2007 Pearson Education, Inc. Hoboken, NJ 07030. All rights reserved. Manufactured in the United States of America. This publication is protected by copyright and permissions should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise. For information regarding permissions, request forms and the appropriate contacts within the Pearson Education Global Rights & Permissions department, please visit www.pearsonhighered.com/permissions/.
Many of the designations by manufacturers and seller to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed in initial caps or all caps.
The author and publisher of this book have used their best efforts in preparing this book. These efforts include the development, research, and testing of theories and programs to determine their effectiveness. The author and publisher make no warranty of any kind, expressed or implied, with regard to these programs or the documentation contained in this book. The author and publisher shall not be liable in any event for incidental or consequential damages with, or arising out of, the furnishing, performance, or use of these programs.
Pearson Education Ltd., London
Pearson Education Singapore, Pte. Ltd.
Pearson Education Canada, Inc.
Pearson Education Japan
Pearson Education Australia PTY, Ltd.
Pearson Education North Asia, Ltd., Hong Kong
Pearson Education de Mexico, S.A. de C.V.
Pearson Education Malaysia, Pte. Ltd.
Pearson Education, Inc., Hoboken
Library of Congress Cataloging-in-Publication Data
Names: Savitch, Walter J., author. | Mock, Kenrick, author.
Title: Problem solving with C++ / Walter Savitch, University of California, San Diego; contributor, Kenrick Mock, University of Alaska, Anchorage.
Description: Pearson, 2017. | Includes index.
Identifiers: LCCN 2016057090
Subjects: LCSH: C++ (Computer program language) | Problem solving.
Classification: LCC QA76.73.C153 S29 2017 | DDC 005.13/3dc23 LC record available at https://lccn.loc.gov/2016057090
ISBN 10: 0-13-444828-6
ISBN 13: 978-0-13-444828-2
VST.Epub.contentReady(window, document); VST.cfiBase='/4';
Preface
This book is meant to be used in a first course in programming and computer science using the C++ language. It assumes no previous programming experience and no mathematics beyond high school algebra.
If you have used the previous edition of this book, you should read the following section that explains the changes to this tenth edition and then you can skip the rest of this preface. If you are new to this book, the rest of this preface will give you an overview of the book.
Changes to the Tenth Edition
This tenth edition presents the same programming philosophy as the ninth edition. All of the material from the ninth edition remains, but with the following enhancements:
Consistent use of camelCase notation rather than underscore_case throughout the text.
Discussion in of shallow vs. deep copy.
Additional material in on compiling templates with header files.
Additional material in on the std::array class, regular expressions, threads, and smart pointers in C++11.
Correction of errata and edits for clarity such as indicating preferred methods for file I/O, naming of terminology, better definition of encapsulation, and removing material that is now standard in C++11 and higher.
Ten new Programming Projects.
Five new VideoNotes for a total of sixty nine VideoNotes. These VideoNotes walk students through the process of both problem solving and coding to help reinforce key programming concepts. An icon appears in the margin of the book when a VideoNote is available regarding the topic covered in the text.
If you are an instructor already using the ninth edition, you can continue to teach your course almost without change.
Flexibility in Topic Ordering
This book was written to allow instructors wide latitude in reordering the material. To illustrate this flexibility, we suggest two alternative ways to order the topics. There is no loss of continuity when the book is read in either of these ways. To ensure this continuity when you rearrange material, you may need to move sections rather than entire chapters. However, only large sections in convenient locations are moved. To help customize a particular order for any classs needs, the end of this preface contains a dependency chart, and each chapter has a Prerequisites section that explains what material needs to be covered before each section in that chapter.
Reordering 1: Earlier Classes
To effectively design classes, a student needs some basic tools such as control structures and function definitions. This basic material is covered in , students can begin to write their own classes. One possible reordering of chapters that allows for such early coverage of classes is the following:
Basics: , which covers additional control structures, could be deferred if you wish to cover classes as early as possible.
Classes and namespaces: . This material covers defining classes, friends, overloaded operators, and namespaces.
Arrays, strings and vectors:
Pointers and dynamic arrays:
Arrays in classes:
Inheritance:
Recursion: . (Alternately, recursion may be moved to later in the course.)
Pointers and linked lists:
Any subset of the following chapters may also be used:
Next page