The code below is the module that is supposed to check if another game should be played. However, even when typing yes or no, it still detects newGame as false, thus causing the while loop to iterate indefinitely regardless of input. What is the issue?
string askNewGame()
{
//Declare variable to store whether to run another game.
string newGame = "no";
//Ask if the program should run another game.
cout << "Do you want to play another game? (yes/no)\n";
cin >> newGame;
//Ensure yes or no are entered.
while (newGame != "yes" || "no")
{
cout << "Please enter yes or no.\n";
cin >> newGame;
}
return newGame;
}