title: Programme Qutting on user input of text instead of integer value
body: <p>Just going through my code and I'm trying to solve an issue when testing for how can I get the programme to stop quitting the console when a user enters an option in the menu in text form for example they want to choose option "1" but decide to type the word "one" instead.</p>
  
  <p>Thanks
  Dan</p>
  
  <pre><code>int numNumbersReqd = 5;
              int chosenOption = 0;
              bool quit = false;
  
              Console.WriteLine("*****************************************************************************");
              Console.WriteLine("* This application is designed to allow you to select the number of numbers *");
              Console.WriteLine("* you wish to enter, and sum the numbers that you provide.                  *");
              Console.WriteLine("*****************************************************************************");
  
              while (quit == false)
              {
                  DisplayMenu();
                  chosenOption = ReadNumber("Please choose an option:");
                  quit = ProcessMenu(chosenOption, ref numNumbersReqd);
  
              }
  
          }
  
          static void DisplayMenu()
          {
              Console.WriteLine("Select an option");
              Console.WriteLine("1. Add numbers");
              Console.WriteLine("2. Change amount of numbers to be entered");
              Console.WriteLine("3. Quit");
          }
  
          static int ReadNumber(string prompt)
          {
              string text;
              int number;
  
  
              Console.Write(prompt);
              text = Console.ReadLine();
              number = int.Parse(text);
  
              return number;
          }
  
          static bool ProcessMenu(int option, ref int numNumbers)
          {
              bool quit = false;
  
              switch (option)
              {
                  case 1:
                      int total;
                      total = GetTotal(numNumbers);
                      DisplayResult(total); // Programme was initally set to display the option that the user had entered from "displayMenu", by changing the variabel from option to total it will now display the answer of the numbers entrered by the user
                      break;
                  case 2:
                      numNumbers = ReadNumber("Please enter the number of numbers to be entered:");
                      break;
                  case 3:
                      quit = IsQuitting();
                      break;
                  default:
                      Console.WriteLine("Unknown option value entered");
                      break;
              }
  
              return quit;
          }
  
          static int GetTotal(int numbersReqd)
          {
              int total;
              int index;
  
              total = 0;
  
              for (index = 0; index &lt; numbersReqd - 1; index++)
              {
                  total = total + ReadNumber("Please Enter Number:");
              }
  
              return total;
          }
  
          static void DisplayResult(int total)
  
          {
              Console.WriteLine("###############################################################################");
              Console.WriteLine("###############################################################################");
              Console.WriteLine("##################                     " + total.ToString() + "                     ##################");
              Console.WriteLine("###############################################################################");
              Console.WriteLine("###############################################################################");
          }
  
          static bool IsQuitting()
          {
              string response;
              bool quit = false;
  
              Console.Write("Do you really wish to quit?");
  
              response = Console.ReadLine();
              response = response.ToLower();
  
              if (response == "yes") // Problem fixed with quit option, "YES" used before was specifying uppercase only inputs which are highly unlikely to be entered by the user which caused the programme to loop back to the start menu,
              {
                  Console.WriteLine("Quiting");
                  quit = true;
              }
  
              return quit;
  </code></pre>