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 trial




1 Answer

Steven Parker
Steven Parker
230,250 Points

You need a string input variable in addition to the numeric one.

Right now, you convert the input into a number in one statement, but then later try to perform a string function and comparison on it. But if you save the string input first you can use it for that test instead of the number:

      var response = Console.ReadLine();  // get the response first as a string
      entry = int.Parse(response);        // then convert it to a number

      //if user types quit for first number
      if (response.ToLower() == "quit")   // check the STRING input here instead

Of course, you'll also need to do something similar with the second entry.