Wrox Programmer Forums
|
BOOK: Beginning Visual C# 2010
This is the forum to discuss the Wrox book Beginning Visual C# 2010 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, ; ISBN: 9780470502266
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2010 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 September 28th, 2010, 01:29 PM
Registered User
 
Join Date: Sep 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 11 semantic error pg 295

In their try it out on page 295 they have a program that goes through primes and in the constructor they have

public Primes(long minimum, long maximum)
{
if (min < 2)
min = 2;
else
min = minimum;

what this does is it always puts min at the value of 2 no matter how you instance the class because if(min < 2) . At that point in the program mins value is always the same so it will always be less than 2. The watch window says it's value is at 0.... so even if you call the program with 200 minimum it will still display primes starting from 2.

It should be
if (minimum < 2)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in Chapter 11 JGPatrick BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 1 January 17th, 2010 04:49 PM
Filtering Data with a Selectbox (Chapter 7 P.295) ralphbethke BOOK: Professional ASP.NET MVC 1.0 ISBN: 978-0-470-38461-9 0 September 16th, 2009 10:08 AM
Chapter 5 pg 156-7 error in book? ericfields6483 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 April 16th, 2009 04:18 PM
Chapter 11 Pg 334 Running Balance JackalBW BOOK: Access 2003 VBA Programmer's Reference 0 November 29th, 2007 04:07 AM
Beginning ASP.NET 2.0 with C# - Chapter09 pg 295 tbroom BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 September 1st, 2006 02:35 PM





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