1

I am trying to make a program that checks if the user has typed in the letter 'J' or 'N'. If the letter is a uppercase J or N is not supposed to matter. How do I change my code to include the lowercase 'j' and 'n' for it to work.

                    string userAnswer;
        Console.WriteLine("Is it warm outside?");
        userAnswer = (Console.ReadLine());
        char yayOrnay = Convert.ToChar(userAnswer);

        if (yayOrnay.Equals('J'))
        {
            Console.WriteLine("Let's go out for a walk!");
        }
        else if (yayOrnay.Equals('N'))
        {
            Console.WriteLine("Let's stay inside!");
        }
        Console.ReadLine();

0 Answers0