View Single Post
  #1 (permalink)  
Old September 22nd, 2010, 12:42 PM
notig notig is offline
Registered User
 
Join Date: Sep 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 4 errata

I went to use the errata form but it required a whole bunch of personal information that I did not feel like giving out. I am not sure why it did that but......... I found something which I believe is MINOR. anyways...

chapter 4 page 77... it says "The switch statement itself attempts to match the string entered with the constant values you have defined,
and, if successful, writes out a personalized message to greet the user. If no match is made, you offer a
generic greeting."

What it says there and what they actually did with the code are two different things. Instead of offering a generic greeting when "no match is made" it offers a generic greeting no matter what because it is done outside of the switch statement. If they wanted to code for what they actually meant (I think) then they should have added the generic greeting through the default statement. Like this:

default:
Console.WriteLine("Hello {0}!", name);
break;