78 439
Assignments Done
Successfully Done
In September 2019

Answer to Question #22770 in C++ for Kim

Question #22770
Write a whole program for presidential Elections, the user will enter his votes based on the code for each candidate. The Program will add the total votes for each candidate and proclaim the winner whoever got the most number of votes. The user will stop in accepting votes if the used entered Letter ‘Q’ to quit. Type ‘V’ to vote and ‘R’ to view the result.
Expert's answer
#include <iostream>

using namespace std;

int main()
{ int voutes[10];

cout<<"how many candidates? please enter number"<<endl;
int n;
int summ;
int sum[n];
int max=0;
for(int i=1;i<=n;i++)
cout << "please enter votes of candidate" <<i<<endl;

for(int j=1;j<=10;j++)
& cin>>voutes[j];
& cout<<endl;
& summ=summ+voutes[j];
cout<<"sum of candidats "<<i<<" ="<<sum[i]<<endl;

& max=sum[i];

& }
cout<<"max= "<<max<<endl;
return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions