Your indentation goes a bit off from line 26 onwards (but that is more of an aesthetic thing which affects the readability of your code, it doesn't affect the code in any other way..The compiler doesn't care about whitespace or readability of code..As long as the syntax is correct the compiler is happy!)
Also your switch statement is incorrect. You need to move your cout and cin statements outside the switch statement. As it stands they'll only get called if the user enters something other than S or R.
Once you've moved those out of the switch, you'll also need to add an opening brace under your 2nd 'for' loop (don't forget to add a closing brace further down!). You should declare your 2nd for loop as Ancient Dragon has suggested.
In other words, your 2nd for loop should look like this:
for (int j = 0; j < nrAttend; ++j)
{
switch (vote)
{
case 'S':
votesForS++;
break;
case 'R':
votesForR++;
break;
default:
votesForO++;
}
cout << "Next: For whom do you vote? ";
cin >> vote;
}
TECHNICAL NOTE: In Ancient Dragons code (and in my code above), we've used the prefix increment operator (++j) instead of the postfix operator (j++) in the increment section of the for loop. This is an old C/C++ optimisation trick.
All you need to know is that the prefix operator is a teeny tiny bit quicker than the postfix operator (I could explain further, but I can't …