高手进来帮忙一下,C++的,其他语言不要
/*
7. Write a program that allows the user to enter the last names of five candidates
in a local election and the number of votes received by each candidate.
The program should then output each candidate’s name, the number of votes received,
and the percentage of the total votes received by the candidate.
Use a minimum of 2 functions (in addition to main).
At least one of those functions must pass an array and its size as parameters.
Your program should also output the winner of the election. A sample output is:
Candidate Votes Received % of Total Votes
Johnson 5000 25.91
Miller 4000 20.73
Duffy 6000 31.09
Robinson 2500 12.95
Ashtony 1800 9.33
Total 19300
The Winner of the Election is Duffy.
*/
#include <iostream>
#include <string>
using namespace std;
// must have 2 function using void function and pass by reference &
int main ()
{
string lastName1,lastName2,lastName3,lastName4,lastName5; // last names of five candidates.
int votesL1, votesL2,votedL3,votesL4,votesL5,total; // votes received
double percent1vote,percent2Vote,percent3Vote, percent4Vote, percent5Vote; // % of Total votes
cout << "Please Enter the Five Candidates' Last name" << endl;
cin >> lastName1 //怎么样可以一起把5个名字一起输入进去还是要一个一个来?
return 0;
}
void function ( )
{
return 0;
}
void function ( )
{
return 0;
}