3 Replies - 1431 Views - Last Post: 10 August 2011 - 07:22 AM

#1 therry  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 25-June 11

conpanion book to Scheme: The Art Of Programming

Posted 09 August 2011 - 03:52 PM

Hi you'al

Is there a companion book that goes with the book "Scheme And The Art of Programming" by George Springer and Daniel P. Friedman?

While it is a good book from which to learn Scheme programming, it does not have the complete answers to the practice problems. That makes learning difficult, because there is no reliable way to double-check to see if you have the correct responses to its assignments. My interrupter (DrRacket) does not always give me good feed-back. It either just give the expression's value, or it gives an error message.

It would be nice to have a companion book that explains 'how' to get the correct answers. As an example, in the following problem where we must Write the scheme expression that denotes the same calculations as the following arithmetic expression:

5 x ((537 x (98.3 + (375 - (2.5 x 153)))) + 255)

My thinking went as follows:

(code)
(* 5 ((* 537 (+ 98.3 (- 375 (* 2.5 153)))) + 255) rewritten as
[/code]

Step 1 = Evaluating within the [] gives

[/b]
(* 5 ((* 537 (+ 98.3 (- 375    [b][(* 2.5 153)][/b]     ))) + 255) rewritten as
(* 5 ((* 537 (+ 98.3 (- 375 382.5))) + 255) rewritten as
[b]


Step 2 = Evaluating within the [] gives

[/b]
(* 5 ((* 537 (+ 98.3      [b][(- 375 382.5)][/b]     )) + 255) rewritten as
(* 5 ((* 537 (+ 98.3 -7.5)) + 255) rewritten as
[b]


Step 3 = Evaluating within the [] gives

[/b]
(* 5 ((* 537      [b][(+ 98.3  -7.5)][/b]      ) + 255) rewritten as
(* 5 ((* 537 (+ 98.3 90.8)) + 255) rewritten as
[b]


Step 4 = Evaluating within the [] gives

[/b]
(* 5 ((* 537      [b][(+ 98.3 90.8)][/b]     ) + 255) rewritten as
[b]


Step 5 = Evaluating within the [] gives

[/b]
(* 5 (     [b][(* 537 189.1)][/b]     + 255) rewritten as
[b]


Step 6 = Evaluating within the [] gives

[/b]
(* 5    [b][(+ 101546.7 255)][/b]    rewritten as
[b]


Step 7 = Evaluating within the [] gives

[/b]
[b][(* 5 101801.7)][/b] answer----> 101801.7
[b]


Even after all this work, without really good feed-back I do not know if this is the correct answer....therry

Is This A Good Question/Topic? 0
  • +

Replies To: conpanion book to Scheme: The Art Of Programming

#2 I X Code X 1  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 47
  • View blog
  • Posts: 66
  • Joined: 28-July 10

Re: conpanion book to Scheme: The Art Of Programming

Posted 09 August 2011 - 09:21 PM

I have not seen a whole lot of lisp books, in my experience, that have questions at the end of every chapter. A lot just seem to have a somewhat large example going on throughout the book or a small example in each chapter.

I know you're interested in Scheme, but if you ever want to change directions and try Common Lisp there is a book exactly what you're looking for. Ansi Common Lisp by Paul Graham is an excellent starting book. I do NOT recommend it for someone who has never programmed before, but for a decent programmer that wants to learn Common Lisp it's a good start. The best thing about this book is that Paul included an 'Exercises' section at the end of each chapter. Some questions are easy and others are quite challenging. He did not supply answers, but there is a website that has all the solutions. You can use this if you get stuck or want to check your work. Of course, there can be more than one correct way to implement something.

As for your math question, I have answered it in your other post.

This post has been edited by I X Code X 1: 09 August 2011 - 09:22 PM

Was This Post Helpful? 1
  • +
  • -

#3 REDNINJA  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 25-August 07

Re: conpanion book to Scheme: The Art Of Programming

Posted 09 August 2011 - 10:52 PM

I got a different answer....let me do it again just in case.
Was This Post Helpful? 0
  • +
  • -

#4 therry  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 25-June 11

Re: conpanion book to Scheme: The Art Of Programming

Posted 10 August 2011 - 07:22 AM

Thanks REDNINJA for your reply.

I was wrong... your answer was probably correct. I should have place the (+ 255) in the front end. Thanks to IX code XI's response I now have the correct answer... again, thanks for trying to help. I still hope to find an exercise book that also has all the answers to their questions for scheme. If you happen to find one, please let me know....therry
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1