Please Help

i want this program at end to calculate the number of votes per each character and the totals, i am totally lost please help...


#include <iostream>
using namespace std;

int main()
{
int i, number;
char Scarlett,Rhett, Ashley, Melanie, answer, Other;

cout << "GONE WITH THE WIND " << endl<<endl;

cout << "Choose your most interesting character "<< endl;
cout << " S for Scarlett "<< endl;
cout << " R for Rhett "<< endl;
cout << " A for Ashley "<< endl;
cout << " M for Melanie "<< endl;
cout << " anything else for another actor "<< endl<<endl<<endl;

cout << "How many attended this session? "<< endl;
cin >> number;

for (i = 1; i <= number; i++)
{
cout << "Whom do you consider the most interesting character? "<< endl;
cin >> answer;

switch (answer)
{
case 's':
case 'S':
cout << " Scarlett "<< endl;
break;
case 'r':
case 'R':
cout << "Rhett "<< endl;
break;
case 'a':
case 'A':
cout <<" Ashley "<< endl;
break;
case 'm':
case 'M':
cout << " Melanie "<< endl;
break;
default:
cout << "Other" << endl;
}
}

return 0;
}
Just create variables to hold each total, then increment in the appropriate case statement, then output them at the end.
Topic archived. No new replies allowed.