If I input "n" for the first question, the program drops out instead of continuing to the next question. How can I allow the program to go to the next question? I've enabled 0 to be entered if the user wants to exit (all of this is in a do while statement)
cout << "This program is designed to list Pokemon. You may remove a Pokemon or add a Pokemon." << endl;
cout << "Enter 0 to quit." << endl;
cout << "Here are your Pokemon:" << endl;
displayPokemon();
//begin do-while of options
do{
//remove pokemon
cout << "Would you like to remove a Pokemon? (Y/N): ";
cin >> removePokemonChoice;
cin.ignore(5, '\n');
if (toupper(removePokemonChoice) == 'Y')
{
deletePokemon();
cout << "New list:" << endl;
displayPokemon();
}
if (removePokemonChoice == 0); //exit out
return 0;
//add pokemon
cout << "Would you like to add a Pokemon? (Y/N): ";
cin >> addPokemonChoice;
cin.ignore(5, '\n');
if (toupper(addPokemonChoice) == 'Y')
{
addPokemon();
cout << "New list:" << endl;
displayPokemon();
}
if (addPokemonChoice == 0) //exit out
return 0;
}while (toupper(addPokemonChoice) == 'Y' || (toupper(removePokemonChoice) == 'Y'));
Yes that fixes the issue! But the 0 to quit doesn't apply anymore. If you have any more suggestions I will take them. I may just take them out and the user will have to just enter n twice.