Hi so im creating a program to have the user input 5 candidates and votes then the program spits back out the winner and percent of each candidate but i cant seem to figure out why the double varible dont show as a number like 40.5 or something just 0 and 100. I am still learning how this works
string candidate[5];
int votes[5];
int total;
double percent[5];
string winner;
cout << "Enter the first candidate: ";
cin >> candidate[0];
cout << "Enter the amount of votes he/she recieved: ";
cin >> votes[0];
cout << endl << "Enter the second candidate: ";
cin >> candidate[1];
cout << "Enter the amount of votes he/she recieved: ";
cin >> votes[1];
cout << endl << "Enter the third candidate: ";
cin >> candidate[2];
cout << "Enter the amount of votes he/she recieved: ";
cin >> votes[2];
cout << endl <<"Enter the fourth candidate: ";
cin >> candidate[3];
cout << "Enter the amount of votes he/she recieved: ";
cin >> votes[3];
cout << endl << "Enter the fifth candidate: ";
cin >> candidate[4];
cout << "Enter the amount of votes he/she recieved: ";
cin >> votes[4];
total = votes [0] + votes[1] + votes[2] + votes[3] + votes[4];
percent[0] = (votes[0] / total * 100);
percent[1] = (votes[1] / total * 100);
percent[2] = (votes[2] / total * 100);
percent[3] = (votes[3] / total * 100);
percent[4] = (votes[4] / total * 100);
if (votes[0] > votes[1] && votes[2] && votes[3] && votes[4])
winner = candidate[0];
if (votes[1] > votes[0] && votes[2] && votes[3] && votes[4])
winner = candidate[1];
if (votes[2] > votes[1] && votes[0] && votes[3] && votes[4])
winner = candidate[2];
if (votes[3] > votes[1] && votes[2] && votes[0] && votes[4])
winner = candidate[3];
if (votes[4] > votes[1] && votes[2] && votes[3] && votes[0])
winner = candidate[4];
cout << "Candidate" << setw(5) << "Votes" << setw(5) << "Percent" << endl;
cout << "------------------------------------------------" << endl;
cout << candidate[0] << setw(5) << votes[0] << setw(5) << percent[0] << endl;
cout << candidate[1] << setw(5) << votes[1] << setw(5) << percent[1] << endl;
cout << candidate[2] << setw(5) << votes[2] << setw(5) << percent[2] << endl;
cout << candidate[3] << setw(5) << votes[3] << setw(5) << percent[3] << endl;
cout << candidate[4] << setw(5) << votes[4] << setw(5) << percent[4] << endl;
cout << "Winner: " << winner << endl;
cout << "Total Votes: " << total;
return 0;}