Console.Clear();
string choice;
Console.WriteLine("Welcome to Costa coffee\n");
Console.WriteLine("1:> Latte\n2:> Cappuccino\n3:> Espresso\n4:> Double espresso");
Console.WriteLine("\nPlease select a coffee by pressing 1-4");
choice = Console.ReadLine();
if (choice == "1")
{
Console.WriteLine("\nYou have selected: latte");
}
if (choice == "2")
{
Console.WriteLine("\nYou have selected: Cappuccino");
}
if (choice == "3")
{
Console.WriteLine("\nYou have selected: Espresso");
}
if (choice == "4")
{
Console.WriteLine("\nYou have selected: Double espresso");
}
else if (choice !="1" || choice !="2" || choice !="3" || choice !="4")
{
Console.WriteLine("Incorrect value, please try again");
}
I'm trying to make the program so that if choice isn't equal to 1,2,3,4 then it will display "Incorrect value, please try again" however it works when I press anything random yet still displays this error message when I press 1,2,3 or 4. Any idea's?
choice != "1" && choice != "2" & ...switch...