Thread: Does anyone have exercise answers for Ivor Horton's Beginning C++ book

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    1

    Thumbs up Does anyone have exercise answers for Ivor Horton's Beginning C++ book

    Published 1998. Answers used to be online in the publishers site, but they have gone for a long time ago. Please, anyone?

  2. #2
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    What is the point of doing exercises ..if you look at answers ?

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    To know if you did it right.
    And if stuck, take a peek at how they did it, and get insight on how it is possible to do such a thing.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by Elysia View Post
    To know if you did it right.
    .\..all you need is some common sense and a compiler.
    And if stuck, take a peek at how they did it, and get insight on how it is possible to do such a thing.
    ..that is a valid point...but taking a peek generally turns into taking a peek every few seconds (and have a shallow copy !)

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by manasij7479 View Post
    .\..all you need is some common sense and a compiler.
    That is not always enough, as you should know. You may think it's right, but in might really not be.
    It might just happen to work for a certain case. But for all other cases, it might be wrong.

    ..that is a valid point...but taking a peek generally turns into taking a peek every few seconds (and have a shallow copy !)
    People can kill other people with guns, but that doesn't stop stores from selling them.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Quote Originally Posted by Elysia View Post
    It might just happen to work for a certain case. But for all other cases, it might be wrong.
    So basically, the example becomes a lesson in debugging. That crucial skill programmers are supposed to have.

    I get the "check your work" motivation for looking at provided answers, but I think you end up comparing the author's solution to yours just to see what they did different logically, and so forth... look at the errata to see if there are any mistakes in the answer etc. (Do people even think about the answer being a good answer?) Since depending on a textbook answer is frankly a mark on my pride, I don't encourage it either.

    But, you know, it's bad to hide the answers from people with that sort of pretense. If the answers aren't online, they probably aren't anywhere except the wayback machine (if it's up) or in a companion workbook. You could also get a teacher's edition of your text.

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    There are problems that can be debugged, and there are problems that cannot. Compile errors is one typical example.
    Put yourself in a newbie's shoes. They don't know what the compile errors mean. But perhaps by peeking at the solution, they might find out where their code differs from the answer, and by means of that, be able to detect and fix such mistakes in the future.

    Also, if you get stuck, have no idea how to proceed after thinking and designing, taking a peek at a solution is usually more enlightening than just banging your head against the wall!
    You can learn a lot by looking at answers and solutions.

    Just looking at solutions and not doing the exercises sure enough won't help you in the end, but there are a lot of legitimate reasons to look at the answers and solutions. Don't underestimate those!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by whiteflags View Post
    You could also get a teacher's edition of your text.
    That surprises me quite a bit..
    Why should a teachers' edition have solutions?
    Unlike Elysia's reasons for students... there can't possibly be good reasons in favour of teachers!

  9. #9
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Quote Originally Posted by Elysia View Post
    There are problems that can be debugged, and there are problems that cannot. Compile errors is one typical example.
    Put yourself in a newbie's shoes. They don't know what the compile errors mean. But perhaps by peeking at the solution, they might find out where their code differs from the answer, and by means of that, be able to detect and fix such mistakes in the future.
    That doesn't teach what compiler errors mean. It gets rid of the error. By ignoring it and writing something possibly completely different. Maybe you really think this is a good practice for people when they give up, but I don't think so. I usually ask a question when I get stumped in the way you mean.

    Also, if you get stuck, have no idea how to proceed after thinking and designing, taking a peek at a solution is usually more enlightening than just banging your head against the wall!
    Only a person who hasn't designed something would think this is a good reason to be spoon fed. Usually you make a test program to figure out if your design works. If you don't have that kind of time, you're stuck running with what you have anyway, and hoping you can refactor the code later.

    You can learn a lot by looking at answers and solutions.

    Just looking at solutions and not doing the exercises sure enough won't help you in the end, but there are a lot of legitimate reasons to look at the answers and solutions. Don't underestimate those!
    Well, I didn't deny that they help, really... but I had to get my opinion out there. And you sound like you agree with me more than you disagree, especially here.

  10. #10
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Quote Originally Posted by manasij7479 View Post
    That surprises me quite a bit..
    Why should a teachers' edition have solutions?
    Unlike Elysia's reasons for students... there can't possibly be good reasons in favour of teachers!
    It's fairly standard. Teachers are likely to have factual answers to a question or exercise already -- most teachers will make their own stuff or at least put a spin on things every year to prevent cheating. But if a textbook has excercises at all, solutions will be provided just as a courtesy. Because teachers would otherwise have to make and correct all the books material. That's a poor education waiting to happen.

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by whiteflags View Post
    That doesn't teach what compiler errors mean. It gets rid of the error. By ignoring it and writing something possibly completely different. Maybe you really think this is a good practice for people when they give up, but I don't think so. I usually ask a question when I get stumped in the way you mean.
    The main thing to note is that you really understand why the error occurs (as in, maybe I made a syntactical error), and how to avoid it. Yes, it is entirely possible to do as you say, but coupled with a proper understanding, it can give you more insight.
    When getting stuck, I think it is indeed a good thing to look at the answer. Because that way you learn. If you simply look at the answer and say, oh, that's just how it's supposed to be, oh well, then you're doing it wrong. If, OTOH, you look at it and say "Aha!", then you've just saved yourself a lot of time.
    Ask questions on a forum is a fine thing, but remember that it takes time to find a board, register, post and wait for a reply. Maybe you just made a small spelling error.

    Only a person who hasn't designed something would think this is a good reason to be spoon fed. Usually you make a test program to figure out if your design works. If you don't have that kind of time, you're stuck running with what you have anyway, and hoping you can refactor the code later.
    I think we're going off the wrong tangent here. Let's switch to mathematics.
    Usually, to solve things by hand, there are all sorts of tricks which you have to learn.
    How did you solve this integral again? Ah, by making this variable substitution.
    If you can't find a solution and then look at the answer, I'm going to bet you that you learned something new. To make the most of it, you can calculate some other similar exercises and make sure you clear them.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 12-10-2010, 12:07 AM
  2. book exercise
    By luigi40 in forum C# Programming
    Replies: 1
    Last Post: 11-13-2005, 11:28 AM
  3. answers for Ivor Horton's Beginning C++?
    By 7stud in forum C++ Programming
    Replies: 1
    Last Post: 03-17-2005, 12:13 AM
  4. "Ivor Horton's Beginning ANSI C++" Wacha think?
    By Zeusbwr in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2004, 07:30 PM
  5. Answers for exercise in K & R
    By kermit in forum C Programming
    Replies: 7
    Last Post: 01-25-2003, 08:38 PM