Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

While loop lowerCase yes

I'm Trying to make (Yes) answer if statment , also respond to Yes answer in lower case (yes)?



while (!participantsAnswerNotYes)

      {

        string participantsAnswer = Console.ReadLine();


        if (participantsAnswer == "Yes")

        {

          Console.WriteLine(" Great!\n LET'S GO " + participantName + "!");

        }

        else if (participantsAnswer == "No")

        {

          Console.WriteLine(" No problem " + participantName + " feel free to comeback when ready. ");

        }

        else

        {

          Console.WriteLine(" " + participantName + ", A Yes or No will suffice.");

        }


      }

Answers

Sign In or Register to comment.