Randy207,
I strongly agree with the reply by gsallis. I hope you have continued your work through the book. The exercises in Chapter 1 are for the purpose of showing how to create projects of various types. The later chapters arre where you actually write code.
If for any reason you wish to use the code provided to see how it works (or other reasons) see
this post I submitted a few minutes ago.
I can see where comparing the results of your code and the author's code may be of benefit from time to time if you take the time to play computer. By play computer I mean go through the code one line at a time and record the results on paper as you understand the results to be. Comparing your code to correctly written code can be a valuable tool.
Once again I echo gsallis. Type the code yourself. It will help you create good habits when composing code and help you understand why you are using every line in the program.
drpepper