Code by Kevin - Bool Challenge (Lecture 27)

bool AskToPlayAgain()
{
	cout << "Do you want to play again? ";
	string Response = "";
	getline(cin, Response);

	cout << "Is it y or Y?" << endl;

	if (Response[0] == 'y') {
		return true;
	}
	else if (Response[0] == 'Y') {
		return true;
	}
	else {
		return false;
	}
};

Privacy & Terms