0

I need help, I am getting an error on line 2. It says ; is expected but one is already there.
Can someone tell me what I am doing wrong?

//Input
		String input;
	
	//Process
		while (input != ("!"))
            {
        if (input == "A" || input == "a")
                {
                    Console.WriteLine("OK");
                }
                else
        if (input == "E" || input == "e")
                    {
Console.WriteLine("OK");
                    }
                else
        if (input == "I" || input == "i")
                        {
Console.WriteLine("OK");
                        }
                else
        if (input == "O" || input == "o")
                        {
                                Console.WriteLine("OK");
                        }
                else
        if (input == "U" || input == "u")
                        {
                                    Console.WriteLine("OK");
                        }
                else
                                    Console.WriteLine("Error");

   Console.WriteLine("Enter a letter: ");
   Console.ReadLine();
   }

// end while
3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by jonsca
0

The immediately visible error is the use of an unassigned local variable (input).

Once that is fixed, you have the critical error of your code simply not working.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.