How do I make an console application run until the user enters “Q”, “q”, “Quit” or “quit” to terminate it?
How do I make an console application run until the user enters "Q", "q", "Quit" or "quit" to terminate it? This is my current code: public class Class1 { [STAThread] static void Main(string[] args) { string userName; int i = 0, totalCal = 0, cal = 1; Console.WriteLine("Welcome to the magical calorie counter!"); Console.WriteLine(); Console.Write("Enter in your name -> "); userName = Console.ReadLine(); for (i = 0; i <= 10; i++) { Console.WriteLine("Hello {0}.....Let's add some calories!!", userName); }// end for loop Console.WriteLine(); while (cal != 0) { Console.Write("Enter some Calories: