Download the PDF of Solution Manual for Problem Solving with C++ 10th Edition Savitch to read all chapters
Download the PDF of Solution Manual for Problem Solving with C++ 10th Edition Savitch to read all chapters
com
https://testbankmall.com/product/solution-manual-for-
problem-solving-with-c-10th-edition-savitch/
OR CLICK HERE
DOWLOAD NOW
Visit now to discover comprehensive Test Banks for All Subjects at testbankmall.com
Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...
https://testbankmall.com/product/solution-manual-for-data-abstraction-
and-problem-solving-with-c-walls-and-mirrors-7th-editioncarrano/
testbankmall.com
https://testbankmall.com/product/solution-manual-for-data-structures-
and-problem-solving-using-c-2-e-mark-a-weiss/
testbankmall.com
Solution Manual for Succeeding in Business with Microsoft
Excel 2010 A Problem-Solving Approach, 1st Edition
https://testbankmall.com/product/solution-manual-for-succeeding-in-
business-with-microsoft-excel-2010-a-problem-solving-approach-1st-
edition/
testbankmall.com
https://testbankmall.com/product/solution-manual-for-succeeding-in-
business-with-microsoft-excel-2013-a-problem-solving-approach-1st-
edition/
testbankmall.com
Test Bank for Data Abstraction & Problem Solving with C++:
Walls and Mirrors, 6/E, Frank M. Carrano, Timothy Henry
https://testbankmall.com/product/test-bank-for-data-abstraction-
problem-solving-with-c-walls-and-mirrors-6-e-frank-m-carrano-timothy-
henry/
testbankmall.com
https://testbankmall.com/product/absolute-c-6th-edition-savitch-
solutions-manual/
testbankmall.com
https://testbankmall.com/product/solution-manual-for-data-abstraction-
and-problem-solving-with-java-walls-and-mirrors-3-e-3rd-
edition-0132122308/
testbankmall.com
Copyright © 2018 by Pearson Education, Inc.
All right reserved. No part of this publication may be reproduced, stored in a retrieval system, or
transmitted, in any form or by any means, electronic, mechanical, photo-copying, recording, or any
other media embodiments now known or hereafter to become known, without the prior written
permission of the publisher. Manufactured in the United States of America.
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where these 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 programs and the applications presented in this book have been included for their
instructional value. They have been tested with care but are not guaranteed for any particular
purpose. The publisher does not offer any warranties or representations, nor does it accept any
liabilities with respect to the programs or applications.
Chapter 7 Arrays
Chapter 14 Recursion
Chapter 15 Inheritance
Chapter 17 Templates
Chapter 1
This document is intended to be a resource guide for instructors using Savitch, Problem Solving with
C++. This guide follows the text chapter by chapter. Each chapter of this guide contains the
following sections:
1. Solutions to, and remarks on, selected Programming Projects
2. Outline of topics in the chapter
3. General remarks on the chapter
***********************************************************************
// Ch1 Programming Project 3.cpp
//
// This program calculates the monetary value of a number of
// quarters, dimes, and nickels.
//
***********************************************************************
#include <iostream>
// ====================
// main function
// ====================
int main()
{
int quarters, dimes, nickels, total;
// Input coins
cout << "Enter number of quarters." << endl;
cin >> quarters;
6
Copyright © 2018 Pearson Education, Inc.
Savitch Instructor’s Resource Guide
Problem Solving w/ C++, 10e Chapter 1
#include <iostream>
using namespace std;
int main()
{
int ACCELERATION = 32;
cout << "\nThe object will fall " << distance << " feet in "
<< time << " seconds.\n";
return 0;
}
7
Copyright © 2018 Pearson Education, Inc.
Savitch Instructor’s Resource Guide
Problem Solving w/ C++, 10e Chapter 1
There seem to be three major approaches to teaching C++ as the first course in programming. In the
one approach, classes and objects are done very early, frequently with a library of some sort that
must be used with the text. In another, all of the ANSI C subset of C++ is covered prior to even
mentioning classes or objects. This text takes a third road that is more middle of the road. Here,
enough of the control constructs and functions are covered prior to doing classes and objects.
However, reorderings of the chapters are possible that allow any of these approaches.
Here is a "classes early" course that follows the text closely. This outline assumes no background in
computing. Topics beyond Chapter 11 may be studied as time permits.
Day days allotted
1 1 Startup business
2-3 2 Chapter 1: Introduction to Computers
4-8 5 Chapter 2: C++ Basics. If the students have programming experience, the time
spent can be significantly reduced.
9-11 3 Chapter 3: Flow of control
12-14 3 Chapter 4: Procedural Abstraction
Test 1
16-18 3 Chapter 5: Functions for all subtasks
19-22 4 Chapter 6: I/O Streams
23-27 5 Chapter 7: Arrays
Test 2
29-32 4 Chapter 8: Strings and Vectors
Chapter 9: Pointers and Dynamic Arrays
33-37 5 Chapter 10: Classes
38-41 3 Chapter 11: Friends and Overloaded Operators
Test 3
5 Chapter 12 Separate compilation and namespaces
3 Chapter 13 Pointers and Linked Lists
3 Chapter 14: Recursion
3 Chapter 15: Inheritance
3 Chapter 16: Exception Handling
3 Chapter 17: Templates
2 Chapter 18: Standard Template Library and C++11
Reorderings:
The author suggests a reordering in the preface that allow almost all of ANSI C (with the tighter
C++ type-checking) to be covered before classes. Several variants on this reordering that allow
classes a bit earlier are presented in the text. The author describes interdependency of the chapters
in the preface of the text. Other reorderings are certainly possible.
8
Copyright © 2018 Pearson Education, Inc.
Savitch Instructor’s Resource Guide
Problem Solving w/ C++, 10e Chapter 1
Chapter 1:
The student should do all the programming assignments in this chapter. These teach the locally
available program development system and familiarize the student with some of the more
common compiler errors. Error messages are quite specific to the compiler being used. It is very
important that the student learn these ideas as early as possible.
This chapter serves as an introduction to computers and the language of computers for those
students who have no computer experience. The terminology is very important. Many students
only want to learn how the programming language works, and seem to be unhappy when they
find that they are required to learn the terminology associated with the language. The students
who learn the terminology have less trouble by far with this course.
Students should be given an indication of the amount of work that must be done before coding
begins. There are instances where several man-years of work have gone into software before a
single line of code was written.
Emphasize the importance of the problem-solving phase of program design. This will save the
student work in the long run. It is further important to emphasize that the problem definition and
algorithm design phases may need correcting once the actual coding and testing is in process. This
is true even if the algorithm was carefully desktop tested. Emphasize that the program design
process is an 'iterative' process. You make a start, test, correct and repeat until you have a solution.
It is a fact that the sooner the coding is started (on most problems), the longer the problem will take
to finish. My students insist on learning this the hard way. The algorithm design can be given a
boost by dividing the problem definition into INPUT, PROCESS, OUTPUT phases. The algorithm
will be primarily concerned with PROCESS, but frequently just getting information into the
computer, or out of the computer in a desirable format is a significant part of the task, if not the
whole problem.
In the text, Section 1.4, subsection "Kinds of Program Errors", there is a discussion of compiler error
messages. The error message from g++ when the wrong operator << or >> is used for input or
output, is something like errormessage.cpp:8: no match for `_IO_ostream_withassign & >> int. The
point is that compiler error messages are not clear, and anything your can do to help students to
associate error messages with errors that cause them will help the student to gain some intuition in
debugging based on compiler messages.
9
Copyright © 2018 Pearson Education, Inc.
Savitch Instructor’s Resource Guide
Problem Solving w/ C++, 10e Chapter 1
Encourage students to put only one statement per line. When errors are made, as they inevitably
are, the compiler is better able to tell us which is the offending statement. The cost is little for the
convenience gained in ability to find errors. The student should take compiler warnings to heart. If
the compiler warns about something, and the student is not absolutely certain what the message is
warning about, the student should treat the warning like the error that it probably is. The bottom
line is that all warnings (in the first course, at least) should be treated as errors. Compilers vary
with respect to what is reported as an error and what is reported with a warning. The GNU project
C++ compiler, g++ is more permissive by default. Encourage your students to compile using
10
Copyright © 2018 Pearson Education, Inc.
Other documents randomly have
different content
mitään, ei muuta kuin takanaan olevat tavaralaudat ja niillä
lankavyyhtiä, nappilaatikoita, kangaspakkoja ja muuta.
Siitä oli hän itsekin selvillä. Eräänä iltana, kun hän mietti, lähteäkö
vai ei merimatkalle, joka parhaassakin tapauksessa vie kolme
viikkoa, hän ihmetellen kysyi itseltään, mikä mahtoi olla
perimmäisenä syynä hänen vastenmielisyyteensä lähtöä kohtaan.
*****
— Teille!?
— Niin.
— On.
— Kosimista?!
— Niin.
— Ei mitään!
— Niin.
— Miksi?
— Lapsellinen?!
— Muille!?
— Niin.
— Eikö!
— Jos minä nyt siis läksisin viimeisen kerran, eikö sinun olisi
ikävä?
— Ei. — Ei vähääkään.
— Nyt päätettävä!
— Niin.
— Niin, niin — tai jos on, niin ei enää tiedä siitä mitään!
— Esa on viisas mies. Hän sanoi minulle: "Ota sinä tämä Anna-
Marja!"
— Etkö muka muista?
— Piki-Juoseppi!
— Niin, niin.
Anna-Marja nauroi.
— Ja minä taas sanon, että Esa ei olisi niin sanonut, jos siinä olisi
istunut joku muu, kuka hyvänsä.
— Ei puhuta.
— En minä haasta.
— Jätetään huomiseen.
— Minä menen.
Hän pysähtyi tiellä usein hyvin turhan asian vuoksi, niinkuin nytkin
juuri ottamaan tieltä erästä peukalonpään kokoista pyöreää ja
tavallista punaisempaa kiveä, jota hän tarkasteli aivan aiheetta ja
heitti jälleen, tai parin askeleen päässä erästä tien ohessa kasvavaa
takiaispensasta, joka työnsi niin reheviä lehtiä varrestaan. Sameli
olisi mielellään mennyt mihin muuhun suuntaan hyvänsä, mutta ei
Anna-Marjan isän valkamaa kohti. Jalat kuitenkin kuljettivat häntä
sinne, kuten palvelevaiset ja typerät orjat ainakin, jotka tekevät
sokeasti käskyn mukaan, vaikka asia näyttäisi menevän päin honkia.
Pitkä vaitiolo.
Sameli tupakoi.
Siinä se nyt oli sanottu kuitenkin. Isä ei virka mitään. Tervaa vain
haapiota ihan rauhallisena. Siirtää pataansa ja tervaa.
— Mitäpä minä siihen sanoisin! Enhän minä mitä sano, kun kerran
kauppa on jo tehty.
— No olihan se hyvä asia, että tuli tuo haapio tervatuksi. Nyt sillä
on siinä aikaa kuivata. Tein työtä sen raappaamisessa koko päivän,
aamuvarhaisesta asti. — No, lähdetäänpäs sitten ylös.
Isä: Ja eilen meni sumu itään. Se ei jää koskaan sinne, vaan tulee
sateena takaisin. (Isä koputteli ilmapuntariaan, joka oli ikkunalla.)
Ilmapuntarikin laskee. Etkös ole aikonut Saksaan mennä?
*****
Sameli jäi kotiin, joka kerta kun "Anna-Marja" sinä kesänä läksi
matkalle.
— Niin.
— "Anna-Marjaan".
— Niin.
— Perämieheksi?
— Tämä.
XI luku.
"ANNA-MARJAN" TUHO.
Yö oli pimeä.
— No?
— Taikauskoa.
— Uskon. Ja minä olen myös sitä mieltä, että nyt olisi matka
jätettävä sikseen tai otettava uusi päämaali, Voionmaalle tai Riikaan
tai mihin hyvänsä. Parasta jäädä tähän. — Tulehan itse katsomaan
niin näet, mitenkä rotat menevät.
— Siltä näyttää, sanoi päämies. Mutta jos tästä leikistä tulee tosi,
annan minä tästä — hän veti pistoolin taskustaan — ja tästä —
vetäen pistoolin toisesta taskustaan — ensimmäiselle miehelle, joka
yrittää lähteä maihin rottien jälkeen tai ei tottele. Oletteko te,
partaiset miehet, ihan hupsuja kuin kummituksia näkevät akat, vai
vieläkö maissa juomanne lähtöryypyt päätänne sekoittavat. Henki se
on minullakin, yhtä kallis kuin teillä kenellä hyvänsä ja perhe kotona,
mutta kyllä minä lähteä aion ja vien teidät jok'ikisen mukanani. Nyt
on länsituuli. Sitä riittänee koko kotimatkaksi ja vie meidät tällä
viikolla joka miehen kotiin lauantaisaunaan. Olkaa huoleti siitä! Ja jos
myrsky tulee, niin onhan tässä hätäsatamia joka puolella merta ja
paras hätäsatama on meren aava ulappa itse ja sitä
jumalanlahjaahan on huomisesta alkaen sen minkä me tarvitsemme.
Käykää maata vain, niin heräätte aamulla virkeinä.
*****
Häntä harmitti se, että Sameli oli tullut hevosella, oriilla, jonka
vertaa ei tunnettu. — "Mokomakin tyhmänylpeä herra! Odottaa
luultavasti hyviä kauppoja tekevänsä laivallaan tulevilla tavaroilla,
koska noin pöyhkeilee. Ei muka jalan päässyt, niinkuin muut, vaan
piti hevonen valjastaa mokomaakin matkaa varten!", ajatteli Piki-
Juoseppi. Jos hän olisi voinut ja jos ei muita ihmisiä olisi ollut, olisi
hän ampunut Samelin hevosen ja Samelin itsensäkin.
Ilta hämärtyi.
Laivaa ei näkynyt.
Pian oli niin sakea lumipyry, että merelle päin näki tuskin
pitemmälle kuin ensimmäiseen kaatuvaan hyökyaaltoon asti.
— Ei näkynyt mitään.
*****
Koko illan oli miettinyt Juoseppi vain yhtä asiaa: Jos Sameli saa
nykyisen "Anna-Marjan" kuorman korjatuksi kätköihinsä talvella
ajettavaksi hevosilla mantereelle myytäväksi, on hän turvattu ainakin
vuodeksi.
Eihän toki!
Toimeen!
Hän meni jälleen kamariinsa.