Wrox Programmer Forums
|
BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer
This is the forum to discuss the Wrox book Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer by Rod Stephens; ISBN: 9780470596906
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 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 June 25th, 2011, 12:02 PM
Registered User
 
Join Date: Nov 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question Ch 11 Ex 1

Hi there, thanks for the book - really enjoying it so far!

I have a question on the Chapter 11 Exercise 1 regarding the logical operators.

The label for the bottom checkbox is:

! ( (A && B) || (A||B) )

Which I'm reading as 'NOT when Both are checked OR when A OR B is checked'. Basically not checked if anything else is.

This is what my code's doing, but in the book there's a statement which says "the checkbox is checked at the same time as one of the others - which one and does it make sense"

Well it doesn't make sense to me because my checkbox doesn't follow the behaviour of any of the other checkboxes, also the illustration in the book shows it as checked when A is checked, but I don't see how that's true...

Can anyone shed any light?

Cheers,

Mark
 
Old June 25th, 2011, 12:16 PM
Registered User
 
Join Date: Nov 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Doesn't matter! I downloaded the code and checked it, and it seems the second condition, the A OR B condition, should be (!A OR !B) thus emulating the Exclusive Or checkbox.

Cheers :)

Mark
 
Old June 25th, 2011, 12:33 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Yes, you figured it out!

But there is a typo on that program's form. (Although you'll probably need a magnifying class to read the form at the small size it was printed in the book.)

The last check box's text should be:

!((A && B) || (!A && !B))

If you ignore the outer !, this is "both A and B, or not A and not B." in other words, either both or neither are checked. Add the outer ! back on and you get the Xor function.

Sorry for the confusion. I'll post an update on the book's web site.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 11 AgrumentOutOfRangeException AZSooner BOOK: Beginning Visual C# 2010 1 February 10th, 2011 05:28 PM
Problem with jquery ch 11 nzg5 BOOK: Beginning ASP.NET 4 : in C# and VB 1 October 4th, 2010 11:57 AM
Ch 11 Question tixrus BOOK: Beginning JavaScript and CSS Development with jQuery 0 April 11th, 2010 05:23 PM
Ch 11 Pg459 Exercise 5 C# brivad BOOK: Beginning ASP.NET 1.0 0 September 10th, 2007 08:59 AM





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