title: Why won't my While loop, loop?
body: <p>Okay I have tried this from every angle I can think of and I think I am over complicating things as per usual! </p>
  
  <p>I am building a console c# application that will ask the user to input a price of an item bought and then for a "customer code" depending on this customer code a certain discount will be applied. </p>
  
  <p>I used a switch statement for this and it all works with error checking (using while loops to keep asking until a correct input is recognised) It is the final part I'm struggling... the console asks the user if they would like to enter more data (jump back to the start of the main loop) with my code if the user inputs an incorrect input it asks again as required also if the user enters 'N' the program terminates. But the bit that isn't working is if the user enters 'Y' they should be able to go back to the start and input more data but this doesn't work =/ I used a "break;" statement to break out of the exit loop and back into the main loop... </p>
  
  <p>At this point the character is 'Y' so the main loop should still be running but instead the console does nothing it just has the cursor on a blank line... it asks for no input and it does not say "press any key to continue". I have gone into as much detail as possible and I'm sorry for the essay =/ ... below is my code... hopefully someone can spot where I am going wrong! </p>
  
  <p>UPDATED: I should also note that I have tried the main loop with (=='Y') and set the variable as 'Y' so that it does the first loop. I have also changed it to a do while loop with the same statement so that is runs through first with a blank character then if it is changed to a 'Y' the loop condition should have been excepted =/</p>
  
  <p>UPDATE: I've noticed the error with my calculation before you all think I'm more of an idiot =/ LOL</p>
  
  <pre><code>namespace W7Task1
  {
      class W7Task1
  {
      // "Main" method begins the execution of the C# application
      static void Main(string[] args)
      {
          char customerCode = '\0';
          double initialCost = 0;
          string customerType = "";
          double finalPrice = 0;
          string userInput = "";
          char continueChar = '\0';
  
          while (continueChar != 'N')
          {
              while (initialCost == 0)
              {
                  Console.Write("\nPlease input the cost of the item: ");
                  userInput = Convert.ToString(Console.ReadLine());
                  try
                  {
                      initialCost = Convert.ToDouble(userInput);
                  }
                  catch
                  {
                      Console.WriteLine("\nPlease input a number!");
                  }
              }
  
              while (customerCode == '\0')
              {
                  Console.Write("\nPlease input your customer code: ");
                  userInput = Convert.ToString(Console.ReadLine());
                  customerCode = Convert.ToChar(userInput);
                  customerCode = char.ToUpper(customerCode);
  
                  switch (customerCode)
                  {
                      case 'A':
                          customerType = "Managerial Staff";
                          finalPrice = (initialCost / 100) * 30 - initialCost;
                          Console.WriteLine("\nThe initial cost of the item is: {0:c}\nYour customer type is: {1}\nThe items final price is: {2:c}\n", initialCost, customerType, finalPrice);
                          break;
                      case 'B':
                          customerType = "Sales Staff";
                          finalPrice = (initialCost / 100) * 20 - initialCost;
                          Console.WriteLine("\nThe initial cost of the item is: {0:c}\nYour customer type is: {1}\nThe items final price is: {2:c}\n", initialCost, customerType, finalPrice);
                          break;
                      case 'C':
                          customerType = "Account Customers";
                          finalPrice = (initialCost / 100) * 8 - initialCost;
                          Console.WriteLine("\nThe initial cost of the item is: {0:c}\nYour customer type is: {1}\nThe items final price is: {2:c}\n", initialCost, customerType, finalPrice);
                          break;
                      case 'D':
                          customerType = "Cash Customers";
                          finalPrice = (initialCost / 100) * 5 - initialCost;
                          Console.WriteLine("\nThe initial cost of the item is: {0:c}\nYour customer type is: {1}\nThe items final price is: {2:c}\n", initialCost, customerType, finalPrice);
                          break;
                      case 'E':
                          customerType = "Credit Card/Cheque";
                          finalPrice = (initialCost / 100) * 0 - initialCost;
                          Console.WriteLine("\nThe initial cost of the item is: {0:c}\nYour customer type is: {1}\nThe items final price is: {2:c}\n", initialCost, customerType, finalPrice);
                          break;
                      default:
                          Console.WriteLine("\nError Please input a valid Customer Code\n");
                          customerCode = '\0';
                          break;
                  }
              }
  
              while (continueChar == '\0')
              {
                  Console.WriteLine("Would you like to input more data?");
                  userInput = Convert.ToString(Console.ReadLine());
  
                  if (char.TryParse(userInput, out continueChar))
                  {
                      continueChar = char.ToUpper(continueChar);
  
                      if (continueChar == 'Y')
                      {
                          break;
                      }
                      else if (continueChar == 'N')
                      {
                          Console.WriteLine("Thankyou for using this application");
                          System.Environment.Exit(0);
                      }
                      else
                      {
                          Console.WriteLine("Please input a 'Y' or 'N'");
                          continueChar = '\0';
                      }
                  }
                  else
                  {
                      Console.WriteLine("Please input a valid character!");
                  }
              }
          }
      }// End of "Main" method
  }// End of "W7Task1" class
  </code></pre>
  
  <p>}</p>