Wednesday
Jul282010
New C# Yellow Book Now Available
Wednesday, July 28, 2010 at 03:25PM
Rob |
2 Comments | in
Downloads,
Teaching,
development
Downloads,
Teaching,
development I've had to give up that Distance Learning course as I was having trouble seeing the teacher.
Wednesday, July 28, 2010 at 03:25PM
Downloads,
Teaching,
development
Reader Comments (2)
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.