Question: Does anyone help me with this C programming problem? Thank you. This is C PROGRAMMING problem In a primary election the results from the mayor's

Does anyone help me with this C programming problem?
Thank you. This is C PROGRAMMING problem
 Does anyone help me with this C programming problem? Thank you.

In a primary election the results from the mayor's race have been reported by each precinct as follows: Votes Cast in Primary Election Candidate Precinct Precinct 2Precinct 3 Precinct 4 Precinct 5 47 267 21 206 121 408 382 21 Declare one of the following: 195 int arrays(with 4 elements each) OR 2) A 2-D array with 4 rows and 5 columns with the votes cast as shown in the table above. Set up a .txt datafile to read in values. There are many ways to set up the datafile. One might look like this: 192 147 186 114 267 48 9012 21 13 Read the data into your array(s) from a datafile. Call a function totals. This function will have as parameters the array(s) of votes cast, a one-dimensional arnay of candidate vote sums, a one- dimensional array of percentages(type double). In the function determine the following: .the sum of all votes cast .the number of votes cast for each candidate .the percentage of the total votes cast that each candidate received. As you are calculating, place the vote totals and the percentages into one- dimensional arrays. You do not need to return the total votes cast, but must calculate it to determine percentages Call a second function printResults. Parameters the one-dimensional array of candidate totals, and the one-dimensional array of percentages. In the function print the total votes cast for each candidate and the percentage of candidate in a table. Example: Cand. 1 906 votes 33.7% Cand. 2 Also in the printResults function, check with an if statement in a loop to see if any of the candidates received more than 50% of the votes cast. If so, declare that candidate to be the winner. If not, print a statement that a ff is required

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!