Hi!
I am doing program to calculate votes.
its very simple but ..........
up to what I did so far it doesn't want to calculate the first vote.
Please tell me what i am missing?
It's what i did so far.
char choice;
int total, voting_station, votes,spoiltVote, totalA, totalB, totalC, totalD, totalE;
//initialise the five totals and spoilt votes to 0
totalA = 0 ;
totalB = 0;
totalC = 0;
totalD = 0;
totalE = 0;
spoiltVote = 0;
voting_station = 0;
cout << "Enter the number of voting stations: " ;
cin >> voting_station;
for (int i= 1; i <= voting_station ; i++)
{
cout << endl;
cout << "VOTING STATION " << i << endl;
cout << "============== " << endl;
// Ask user for whom he wants to vote first
cout << "First voter: For whom do you vote (A, B, C, D or E, X to stop) ? ";
cin >> choice;
//how to count this vote? :twisted:
//Use the while loop
while (choice != 'X' && choice != 'x')
{
cout << "Next voter: For whom do you vote (A, B, C, D or E, X to stop) ? ";
cin >> choice;
switch ( choice)
{
case 'A':
case 'a':
totalA ++ ;
break;
and so on..........