Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBen Schindler
895 PointsNeed some help in fixing this code -- tell me what is wrong :P
namespace System { class Program {
bool active = true;
bool inputMismatch = true;
static void Main()
{
while (Program.active)
{
Console.WriteLine("Please enter a value");
var userInput = Console.ReadLine();
Console.WriteLine("You typed: " + userInput);
while (inputMismatch == true)
{
Console.WriteLine("Do you wish to continue? (y/n)");
userInput = Console.ReadLine();
if (userInput == "y" | userIpnut == "Y")
{
active = true;
inputMismatch = false;
}
else if (userInput == "n" | userInput == "N")
{
active = false;
inputMismatch = false;
}
else
{
active = true;
Console.WriteLine("You need to enter y or n.");
}
}
}
}
} }