Greetings, experts!
I'm having a bit of a problem importing some working code from last
night into Visual Studio. The code compiles correctly, but when I run
the program, it doesn't seem to open the text window to ask for input.
It simply errors on the ReadLine statement. (See the attached code.)
When I use "Start Without Debugging", I received an exception window
that says "An exception 'System.ArgumentNullException' has occurred in
CSharp2.exe". It then gives me the option to debug. ("Do you want to
debug using the selected debugger?") When I press the "Yes" button, the
program shows the error on the line "double radius = double.Parse
(Console.ReadLine());"
I speculate that this is some configuration problem with my local
environment, but (after much searching) I can't find any.
Do you have any ideas on this one?
Thank you!
Dave
here's the source-code:
using System;
namespace CSharp2 {
public class GetArea {
static void Main(string[] args) {
Console.Write("Radius: ");
double radius = double.Parse(Console.ReadLine());
while (radius != 0) {
double area = radius * Math.PI;
Console.WriteLine("With radius = " + radius + ", Area =
" + area);
Console.Write("Radius: ");
radius = double.Parse(Console.ReadLine());
} // while (radius != 0)
} // static void Main
} // public class GetArea
} //namespace CSharp2