Thought for the Dazed

I've had to give up that Distance Learning course as I was having trouble seeing the teacher.

Flickr
www.flickr.com
RobMiles' items Go to RobMiles' photostream
Twitter
C# Yellow Book

Search entire site
« Delegates, Events and Confusion | Main | Back to Work »
Wednesday
Jul282010

New C# Yellow Book Now Available

C# Yellow Book 2010 Cover
Now with new “Crinkle Cut” cover

The new version of my famous C# Yellow Book is now available for download. This free 197 page book is the basis of our programming course and has a whole bunch of new content, along with reorganised layout and proper sections. Get yours today from here:

http://www.csharpcourse.com/

Reader Comments (2)

Can I just pick one up in the flesh if possible?
July 31, 2010 | Unregistered CommenterJoel
static double readValue (
string prompt, // prompt for the user
double low,
// lowest allowed value
double high
// highest allowed value
)
{
double result = 0;
do
{
Console.WriteLine (prompt +
" between " + low +
" and " + high );
string resultString = Console.ReadLine ();
result = double.Parse(resultString);
} while ( (result < low) || (result > high) );
return result ; //why return result? why not return 0 or 1 or 999? The program does the same?
}

Im new to c# programming and my doubt is that i dont understand one line: return result. I know it need the return because it is not a void method but why "result"? what's the difference if i use 0 or any other number? Thanks in advance.
August 28, 2013 | Unregistered CommenterYoshimi Liliana

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.