cin >> userInput;
while (userInput !="q")
if (userInput == "Play" || userInput == "play")
// We want to get out of this loopbreak;
elseif (userInput == "quit" || userInput == "Quit")
// We want to get out of this loop and programreturn 0;
Think about the logic.
IF userInput == "q" THEN the loop is skipped entirely
IF userInput == "play" THEN you skip out of the loop
IF userInput == "quit" THEN you skip out of the program
IF none of those were true, THEN the loop continues forever
In a loop: break; ends the loop, jumps out continue; skips rest of the body of loop and starts new iteration (if condition is still true)
@maulk. Please don't delete posts. It's not good forum etiquette. It doesn't endear yourself for others to help next time you have a question.
It also hinders other people who may have similar issues from finding already answered questions. The best thing you can do once you receive a valid answer, is to mark the question as solved and this will save others the time of reading through to see if its been adequately answered