I have some problems with using enums with switch.My task is to enter the name of the country and then show which part of the world is that one. I can't read enums from the keyboard.Did I make mistakes?Thanks for the help. `
class Program
{
enum Country{ Spain,USA,Japan };
static void Main(string[] args)
{
Country country = new Country();
Console.WriteLine("Enter the number of country\n 1.Spain \n 2.The USA \n 3.Japan");
country = Console.ReadLine();
switch (country)
{
case Country.Spain:
Console.WriteLine("Its in Europe");
break;
case Country.USA:
Console.WriteLine("Its in North America");
break;
case Country.Japan:
Console.WriteLine("Its in Asia");
break;`enter code here`
}
Console.ReadKey();
}
}