I don’t know if it is just me being thick but I have a bit of validation code to check for a yes or no answer.
I can’t seem to get it to work I have used the code in other places in my program and it works but I can’t spot the error if there is one. The code runs through the while anyway no mater what the input character is.
string correctDestenation = Console.ReadLine().ToLower();
while (correctDestenation != "y" || correctDestenation != "n")
{
Console.WriteLine(
"Oops! You must enter a 'y' for yes and a 'n' for no");
correctDestenation = Console.ReadLine().ToLower();
}
Your logic is incorrect. You want to use && instead of ||.
or, you can use De Morgan’s Law and look at it the other way, which is equivalent: