C++ can't break out of WHILE loop

Hi all,
Total newbie here and having problems with an assignment from class. Need to incorporate a WHILE (loop) and an IF condition while keeping track of voting. I thought I was doing this write but I can't break out of my loop. Any help is nice. Please be kind, I am only 4 weeks into this.

*Keep in mind I need to adhere to simple logic with basic commands. I understand there are probably 5 different ways to do this better. THANKS for the help all. I hope to start contributing here soon.

CONCEPT
The conept is to ask the user to vote for one of three descrete items. Let the user keep voting while keeping track of the number of votes. If the user types done, show total number of votes. My thought was to determine whether the user has typed done first, then break to totals if YES. WHen I type done, I keep getting ERROR #1 from loop instead of IF statement outside of loop. I have a feeling this is a simple logic problem that I cant wrap my head around.

string vote;
int pop_COUNT=0, cand_COUNT=0, nach_COUNT=0;


while (vote != "done" || vote != "Done" || vote != "DONE")
{
cout << " Please vote for your favorite movie snack! " << endl;
cout << " POPCORN, CANDY, or NACHOS? " << endl;
cout << " " << endl;
cout << "____________________________________________" << endl;
cout << " " << endl;
cout << " ---Type 'done' to end voting--- " << endl;
cout << " " << endl;
cout << "____________________________________________" << endl;
cout << " " << endl;
cout << " " << endl;
cout << setw(8) << " POPCORN: " << pop_COUNT << setw(14) << " CANDY: " << cand_COUNT << setw(16) <<" NACHOS: " << nach_COUNT << endl;
cout << " " << endl;
cout << "____________________________________________" << endl;
cout << "VOTE: ";
cin >> vote;

if (vote == "POPCORN" || vote == "Popcorn" || vote == "popcorn")
{
++pop_COUNT;
system("CLS");
cout << "That is " << pop_COUNT << " votes for POPCORN!" << endl;
cout << " " << endl;
cout << " " << endl;
vote = "null";
cout << "**********************************************" << endl;
cout << " " << endl;
}
else if (vote == "CANDY" || vote == "Candy" || vote == "candy")
{
++cand_COUNT;
system("CLS");
cout << "That is " << cand_COUNT << " votes for CANDY!" << endl;
cout << " " << endl;
cout << " " << endl;
vote = "null";
cout << "**********************************************" << endl;
cout << " " << endl;

}
else if (vote == "NACHOS" || vote == "Nachos" || vote == "nachos")
{
++nach_COUNT;
system("CLS");
cout << "That is " << nach_COUNT << " votes for NACHOS!" << endl;
cout << " " << endl;
cout << " " << endl;
vote = "null";
cout << "**********************************************" << endl;
cout << " " << endl;

}
else
{
system("CLS");
cout << "ERROR #1 Sorry, that was not an option. Please try again." << endl;
system("PAUSE");
system("CLS");
vote = "null";
cout << "**********************************************" << endl;
cout << " " << endl;

}
}
if (vote == "done" || vote == "Done" || vote == "DONE")
{
cout << "___________________________________________" << endl;
cout << "________________TOTAL VOTES________________" << endl;
cout << " " << endl;
cout << " POPCORN:" << pop_COUNT << "CANDY:" << cand_COUNT << "NACHOS:" << nach_COUNT << endl;
cout << "___________________________________________" << endl;
}
else
{
cout << "ERROR #2 Sorry, that was not an option. Please try again.2" << endl;
}





}


I added a value to the string vote when setting variables.

string vote = "done";

It works now but I have NO IDEA why? Still looking for some feedback or explanation on why setting the variable EQUAL to the value that my loop is looking for made this work. Glad its working but need to know why otherwise, I won't learn. THanks

Thank you in advance.
Please post using tags.
Well it should give you error #1 as you didn't enter one of the three options. After that, though, it should exit the loop and give you the total votes. Note that error #2 is actually impossible as it is; you can't leave the loop without vote being "done".

And yes, please use [code][/code] tags and indentation.
Topic archived. No new replies allowed.