[MonoDevelop] ReadLine does not stop for input

fastone ourshopper at cox.net
Thu Mar 24 16:32:54 EDT 2011


Hello Everyone,

I'm new to this list so I hope this is appropriate.

I'm working on a C# online course and using MonoDevelop and Mono on my  
mac to do my coursework and I've run into a problem that I'm hoping  
someone can help me with. I'm trying to debug the following code:

public class Lesson3Part2
{
	public static void Main()
	{
		System.Console.Out.Write("Enter the first number:");
		string num1String = System.Console.ReadLine();
		double num1 = System.Convert.ToDouble(num1String);
		
		System.Console.Out.Write("Enter the second number:");
		string num2String = System.Console.ReadLine();
		double num2 = System.Convert.ToDouble(num2String);
		
		double sum = num1 + num2;
		
		System.Console.Out.WriteLine("The sum is " + sum);
	}
}

When I get to any line with "System.Console.ReadLine()" the code does  
not stop for input. Instead, it continues to the end of the main  
routine without pause for input. The code was taken from the lesson  
verbatim and so I assume it should work.

When I run the code in the debugger an "Application output" window  
comes up with the following output:
" Enter the first number:Enter the second number:The sum is 0"

Questions: Should I be able to enter input into the "Application  
Output" window? If not, then how? If so, then can anyone explain what  
my problem might be?

Before anyone suggests it I've already asked my professor and he was  
no help at all.

Thanks in advance for any help.


More information about the Monodevelop-list mailing list