I am trying to write a method that will check to see if a number is positive or not and I keep getting an error that says "not all code paths return a value" and I am unsure what I am doing wrong...
public static double IsValad(double x)
{
Boolean loopValue = true;
while (loopValue == true)
{
if (x > 0)
{
loopValue = false;
return x;
}
else
{
Console.WriteLine("Error: Please enter a positive value.");
x = double.Parse(Console.ReadLine());
return x;
}
}
}