using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CSharpSwitch { class Program { static void Main(string[] args) { //Declare Variable string myCountry; //Prompt the user to enter his/her Country Console.WriteLine("Please Enter a Country: "); myCountry = Console.ReadLine(); //The switch statement takes a variable and compares it to the "case(s)" values switch (myCountry) { case "England": //If the user has entered "England", this block will be executed Console.WriteLine("Your Capital is London. \n"); break; case "France": //If the user has entered "France", this block will be executed Console.WriteLine("Your Capital is Paris. \n"); break; case "Germany": //If the user has entered "Germany", this block will be executed Console.WriteLine("Your Capital is Munich. \n"); break; default: //If the user didn't enter any option of the above options, this block will be executed Console.WriteLine("The Capital is Unknown. \n"); break; }//End of switch block //Exit The program when user clicks on any key Console.WriteLine("\nPlease press any key to Exit"); Console.Read(); } } }