473,242 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,242 software developers and data experts.

Accelerated C++ Sample Solutions

I am reading through Koenig and Moo's "Accelerated C++" and attempting the
exercises. Are there any sample solutions somewhere? It's all very well me
doing a solution, which seems to work, but for all I know it can be riddled
with undefined behaviours and bad C++. The alternative is to post my
solution to every single exercise and ask for guidance, but I actually think
that is counter-productive and tantamount to spamming anyway. A set of
sample solutions would be ideal. Do they exist?

--
Martin
http://martinobrien.co.uk/

Jul 19 '05 #1
8 7879
Martin <martin.o_brien@[no-spam]which.net> wrote in message
news:3%*******************@fe12.atl2.webusenet.com ...
I am reading through Koenig and Moo's "Accelerated C++" and attempting the
exercises. Are there any sample solutions somewhere? It's all very well me
doing a solution, which seems to work, but for all I know it can be riddled with undefined behaviours and bad C++. The alternative is to post my
solution to every single exercise and ask for guidance, but I actually think that is counter-productive and tantamount to spamming anyway. A set of
sample solutions would be ideal. Do they exist?


This was recently asked in alt.comp.lang.learn.c-c++. The thread is here:
http://tinyurl.com/ro2q

DW

Jul 19 '05 #2
"David White" wrote
This was recently asked in alt.comp.lang.learn.c-c++. The thread is here:
http://tinyurl.com/ro2q


Thanks for that David. It seems from that thread the answer is "no." Shame.

--
Martin
http://martinobrien.co.uk/

Jul 19 '05 #3

"Martin" <martin.o_brien@[no-spam]which.net> wrote in message
news:wB*********************@fe07.atl2.webusenet.c om...
"David White" wrote
This was recently asked in alt.comp.lang.learn.c-c++. The thread is here: http://tinyurl.com/ro2q
Thanks for that David. It seems from that thread the answer is "no."

Shame.

Indeed it is. However, coming up with a good set of solutions is an
enormous amount of work, because not only must the solutions be exemplary,
but they must be accompanied by explanations of what the decisions were
behind those particular solutions. Perhaps for that reason, the books I
know of that give solutions to the problems in well-known C++ books are
usually written by someone other than the original book's author(s).

Having solutions readily available is not an unalloyed benefit, either. The
problem is that some readers will be tempted to read the solutions rather
than solving the problems on their own.

Still, perhaps it might make sense to consider putting some hints about
particularly interesting questions on the book's website. I'll think about
that.
Jul 19 '05 #4

"Andrew Koenig" <ar*@acm.org> wrote in message
news:1d***********************@bgtnsc04-news.ops.worldnet.att.net...


Having solutions readily available is not an unalloyed benefit, either. The problem is that some readers will be tempted to read the solutions rather
than solving the problems on their own.

Still, perhaps it might make sense to consider putting some hints about
particularly interesting questions on the book's website. I'll think about that.


That would be the best of both worlds. Interestingly, there are often
questions here regarding problems to work on. e.g. "I have been programming
for a little while and have written some very simply programs. Can anyone
suggest some 'assignments' for me to try?" That is of course what the
exercises are there for. On the other hand, giving a clue as to what you
had in mind (specifically what features from the chapter you wanted to
exploit or combine, or what points you were referring to) could be very
helpful.
Jul 19 '05 #5
"Andrew Koenig" <ar*@acm.org> wrote:
Indeed it is. However, coming up with a good set of solutions is an
enormous amount of work, because not only must the solutions be exemplary,
but they must be accompanied by explanations of what the decisions were
behind those particular solutions. Perhaps for that reason, the books I
know of that give solutions to the problems in well-known C++ books are
usually written by someone other than the original book's author(s).
Do you mean you set the Exercises without attempting the solutions yourself?
:-) You must have had an idea of what the resulting code would look like.
Some of the Exercises are straightforward and providing answers would be
almost trivial: for example, deciding whether the program is valid or not or
Exercise 0-9 "What's the shortest valid program?" Naturally, there are far
more complex Exercises in the book, and they are probably the ones we're
discussing.

I've tried solutions to the earlier ones in the book, and I honestly don't
know whether they're good, full of undefined behaviours, bad practice, or
what. The fact they compile and produce the correct results doesn't exclude
that of course. I didn't want to post every attempt on here either as it's
tantamount to spamming.

Having solutions readily available is not an unalloyed benefit, either. The problem is that some readers will be tempted to read the solutions rather
than solving the problems on their own.
Kernighan & RItchie's "The C Programming Language" had exercises. A set of
solutions was published in Tondo & Gimpel's "The C Answer Book." I found
both books an enormous aid in helping me to learn C.

You're right of course, some people would look at the solutions before
attempting the questions. I wouldn't because I actually want to learn C++.
But there you go...

Still, perhaps it might make sense to consider putting some hints about
particularly interesting questions on the book's website. I'll think about that.


That'll certainly be a step in the right direction.

Martin

Jul 19 '05 #6
"Martin" <martin.o_brien@[no-spam]which.net> threw a soggy newspaper
against the wall, and here's what stuck:
I am reading through Koenig and Moo's "Accelerated C++" and attempting
the exercises. Are there any sample solutions somewhere? It's all very
well me doing a solution, which seems to work, but for all I know it
can be riddled with undefined behaviours and bad C++. The alternative
is to post my solution to every single exercise and ask for guidance,
but I actually think that is counter-productive and tantamount to
spamming anyway. A set of sample solutions would be ideal. Do they
exist?


I've begun that task.

http://www.parkscomputing.com/acpp/

PMP
Jul 19 '05 #7
"Paul M. Parks" <pa********@hNoOtSmPaAiMl.com> threw a soggy newspaper
against the wall, and here's what stuck:
"Martin" <martin.o_brien@[no-spam]which.net> threw a soggy newspaper
against the wall, and here's what stuck:
I am reading through Koenig and Moo's "Accelerated C++" and attempting
the exercises. Are there any sample solutions somewhere? It's all very
well me doing a solution, which seems to work, but for all I know it
can be riddled with undefined behaviours and bad C++. The alternative
is to post my solution to every single exercise and ask for guidance,
but I actually think that is counter-productive and tantamount to
spamming anyway. A set of sample solutions would be ideal. Do they
exist?


I've begun that task.

http://www.parkscomputing.com/acpp/


By the way, I welcome any suggestions. One that I had recently was to
provide a hint for each exercise *before* the solution.

PMP
Jul 19 '05 #8
> Do you mean you set the Exercises without attempting the solutions
yourself?

In general, yes.
:-) You must have had an idea of what the resulting code would look like.
Of course.
Some of the Exercises are straightforward and providing answers would be
almost trivial: for example, deciding whether the program is valid or not or Exercise 0-9 "What's the shortest valid program?" Naturally, there are far
more complex Exercises in the book, and they are probably the ones we're
discussing.


Right.

In general, there's a big gap between a solution to a problem that's good
from a programming standpoint and one that's good from a teaching
standpoint. Ideally, one would like sample solutions to be ones that, in
addition to being correct, teach something useful to whoever reads them.
Jul 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Magic1812 | last post by:
Magic Software invites you to join us this coming Tuesday (January 13th, 2004) at 12:00 EDT / 17:00 GMT for a FREE live Webinar: Title: Accelerated Application Integration and Information...
0
by: Magic1812 | last post by:
Magic Software invites you to join us this coming Tuesday (January 13th, 2004) at 12:00 EDT / 17:00 GMT for a FREE live Webinar: Title: Accelerated Application Integration and Information...
0
by: Ravindra | last post by:
Well I installed the framework provided by microsoft , the problem is I am able to activate the smart tag in the doc file but when I Click on the Show Detils option in the information bridge the...
35
by: Markus Dreyer | last post by:
I suggested our Librarian for the University Library to buy Accelerated C++. Practical Programming by Example. by Andrew Koenig and Barbara E. Moo http://www.acceleratedcpp.com/ but she...
5
by: Ale | last post by:
Ciao a tutti. Ho eliminato il database di esempio SAMPLE(non cancellato). Ora lo voglio reinstallare ma durante l'installazione mi da il seguente errore: nella finestra con scritto SQL1005N c'è...
14
by: Pete | last post by:
Is anyone familiar with this book? Exercise 6-1 of Accelerated C++ asks us to reimplement the frame() and hcat() operations using iterators. I've posted my answers below, but I'm wondering if...
1
by: utab | last post by:
Hi there, I have been reading Accelerated C++ by Andrew Koenig which is an excellent way of learning C++ from even the first pages by using the standard library. One drawback is that no...
1
by: blangela | last post by:
I am currently teaching 2 part-time (one evening per week) C++ courses using the Deitel & Deitel "C++ How To Program" text. Each course is 13 weeks in length, including time for labs and exams. ...
16
by: Michael Bell | last post by:
I did an the Open University course MT262. I got 3/4 the way through it and only really came unstuck at classes. Following the advice of many, on this list and elsewhere, and impressed by their...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.