Hi.
I would like the program to take the character/symbol/number right away after they had been pressed to avoid string being entered.
static void Main(string[] args)
{
char E;
string response;
do
{
Console.WriteLine("Please select your products :");
Console.WriteLine("Oranges - press O");
Console.WriteLine("Apples - press A");
Console.WriteLine("Potatoes - press P");
Console.WriteLine("To see your items press E.");
response = Console.ReadLine();
E = Convert.ToChar(response);
switch (E)
{
case 'O':
Console.WriteLine("You have ordered an Orange.\n");
break;
case 'A':
Console.WriteLine("You have ordered an Apple.\n");
break;
case 'P':
Console.WriteLine("You have ordered a Potato.\n");
break;
case 'E':
Console.WriteLine("Closing program.");
break;
default:
Console.WriteLine("Please select again.");
Console.WriteLine();
break;
}
}
while (E != 'E');
}