Wrox Programmer Forums
|
BOOK: Beginning Object-Oriented Programming with C#
This is the forum to discuss the Wrox book Beginning Object-Oriented Programming with C# by Jack Purdum; ISBN: 978-1-1183-3692-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Object-Oriented Programming with C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 17th, 2013, 01:14 AM
Registered User
 
Join Date: Jan 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 3 Exercises

Just out of curiosity, was exercise 5 at the end of chapter 3 meant to throw us off? I was perplexed at the request to build this program and after looking in Appendix A for the solution, found that some of the code used we had not even gone over yet in the book (such as the Const keyword for example).
 
Old January 18th, 2013, 04:47 PM
Friend of Wrox
 
Join Date: Sep 2008
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default Misleading

The exercise wasn't meant to throw you off, but rather to make you think. With the first edition of this book, several readers said the exercises were too easy. This is sort of a response to those comments.

First, I hope no one looks at the solution before they attempt to write their own answer. The real issue here was to see if you could: 1) figure out a random number generator method was needed, 2) find the random class in the library, and 3) if you could use that method correctly.

Assuming you wrote your own version, no doubt you didn't use the const keyword. since it is not introduced until the next chapter. However, after writing your version and looking at mine, I'll bet you did look the keyword up and figured out why it was used. Now, if you were a teacher, which method helps the student learn and retain: 1) a method that just presents an answer, or 2) a method that makes the student devise and understand the answer?

Finally, I almost always present answers in the book the way I would answer the problem. Indeed, you can leave const out of the solution and it works just fine. Figuring that out, you should then ask yourself: "If it works without it, why did he use it?" Taking that approach will make you a better programmer.

In some cases, my solution may use a concept not yet covered, but if that is the case, the concept will always be simple and is used to illustrate its use, not really teach its use. If you find another answer like this, just take a quick look in the index and read a paragraph or two and it should become clear. When the concept is actually discussed in the book, hopefully you'll recall this program and the "ah-hah" light will go on.
__________________
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 exercises Dwayne BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 9 January 8th, 2009 06:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.