Why didn't I think about it like this earlier?
Now I need to think on how to make a bar graph.
Code:
//User input poll of "Do you like _______ ?"
//3 possible poll responds; r1, r2, r3.
#include <iostream>;
#include <string>;
using namespace std;
int main()
{ //question
string poll;
//answers
string respond;
cout << "NOTE: There are only 3 possibles answers to this poll:\n";
cout << "1.yes.\n";
cout << "2.no. \n";
cout << "3.no idea \n";
cout << "Press the answer's number and then ENTER to add poll.\n";
cout << "Example: press 1 to answer yes.\n";
cout << "To end poll, press 0 until the output to asks for vote ends.\n";
cout << "What would you like to ask? (Type below) \n\n";
getline(cin, poll);
cout << "\n\n\n";
cout << "Now each person press either 1,2, or 3 to vote.\n";
cout << "Once vote has complete, press 0 to exit poll and look at resulting bar graph.\n";
cout << "\n\n";
while ( respond != "0" )
{
cin >> respond;
if ( respond != "1" && respond != "2" && respond != "3" && respond != "0" )
{ cout << "Invalid choice. Choices: 1 (yes), 2: (no), 3 (no idea) and 0 (exit poll).\n"; }
}
system("pause");
return 0;
}