void continueBattle() //tests whether a user wants to continue the battle or not
{ /*interaction */
string choice; // define variable in this section
do
{
cout<<"\n Another battle (enter: Y/N) ? ";
cin >> choice;
cout << choice << endl;
if (choice == "Y" || choice == "y") //user can enter Y or y.
{
system("cls");
}
else if (choice == "N" || choice == "n") //user can enter N or n.
{
exit(0);
}
else
{ // error message if user does not enter Y or N.
cout<<" Invalid input. Enter only 'Y' or 'N' please."<<endl;
}
} // loops to check for invalid input
while(choice != "Y" && choice != "y" && choice != "N" && choice != "n");
}