Yes or No? | Sololearn: Learn to code for FREE!


Yes or No?

The game expects input from the user in a YES or NO format. If the format is incorrect, the program should ask again. I want the game to use different funny phrases instead of boring ones like "Please enter yes or no". English is not my native language and I find it difficult to come up with such phrases. I would be glad if you can help me come up with these phrases in English.

8/22/2020 5:30:50 PM

Jegors Čemisovs

2 Answers

New Answer


Come on, yes or no?


Store your quotes in an arrays, lists vector or other container/construct of the language you are using. Everytime a wrong value is entered, generate a random number between 0 and length of the container and use that as index/key in the container that contain those quotes. Please use appropriate title of your question to keep the context relevant. Mention the language.