|
-
July 26th, 2010, 03:11 PM
#10
Re: Brain not working - Need help on 2 methods ...
 Originally Posted by CarlMartin10
The book wants me to add to the code what is needed. I could easily write it all differently, but that defeats the purpose of doing what they ask me to do, and the lesson it is supposed to reinforce.
A loop that is hard-coded to only execute once is either a typo (and if this is from a book, it's fairly common to find code bloopers in books) or a deliberate error that you're expected to correct. I don't know which, but either way, you should fix it. As it is, it doesn't loop - it's clearly wrong. Having said that, the loop statement should be removed entirely - given the context, it's clearly unnecessary and potentially confusing.
YMMV.
Question authority; but, raise your hand first...
A. Dershowitz
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|