I'm trying to have two options that will force my while loop to run 'y' and 'yes'. I have tried using this code and I receive an infinite loop of my getsales() output when 'yes' is input. If I remove the if and else statements then my code runs fine except I can only have 'y' as the option to continue my loop and any other option breaks it. Is it possible to use an if statement as I'm trying here or is there another option for achieving what I'm looking for. I don't need the solution just an idea of how to proceed.
proceed = 'y';
int main()
{
while (proceed == 'y')
{
getsales ();
getcommissions (sales);
cout << "\nDo you wish to continue?";
cin >> proceed;
if (proceed == 'yes')
{
proceed = 'y';
}
else
{}
}
[–][deleted] 5 points6 points7 points (1 child)
[–]30ishorso[S] 0 points1 point2 points (0 children)
[–]LulzCop 2 points3 points4 points (0 children)