Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Parallel Arrays Assignment The presidential election for the student council of

ID: 3632864 • Letter: P

Question

Parallel Arrays Assignment

The presidential election for the student council of your local university will be held soon. For reasons related to confidentiality, the chair of the election committee wants to computerize the voting. The chair is looking for someone to write a program to analyze the data and report the winner. Let us write a program to help the election committee.

The university has four major divisions, and each division has several departments. For the purpose of the election, the four divisions are labeled as Region 1, Region 2, Region 3, and Region 4. Each department in each division manages its own voting process and directly reports the votes received by each candidate to the election committee. The voting is reported in the following form:

Candidate-name region# number_of_votes_for this_candidate

The presidential election for the student council of your local university will be held soon. For reasons related to confidentiality, the chair of the election committee wants to computerize the voting. The chair is looking for someone to write a program to analyze the data and report the winner. Let us write a program to help the election committee.

The university has four major divisions, and each division has several departments. For the purpose of the election, the four divisions are labeled as Region 1, Region 2, Region 3, and Region 4. Each department in each division manages its own voting process and directly reports the votes received by each candidate to the election committee. The voting is reported in the following form:

Candidate-name region# number_of_votes_for this_candidate

Below is input specification:
===============================================================
Name Region 1 Region 2 Region 3 Region 4
------ ---------- ---------- ----------- -----------
Balto 0 0 0 272
Doc 25 71 156 97
Sally 38 88 5 101
Raju 115 75 20 33
Rema 49 71 18 0


The election committee wants the output in the following tabular form:

---------------------- Election Results ----------------------

Candidate Votes
Name Region 1 Region 2 Region 3 Region 4 Total
------------ ---------- ---------- ----------- ----------- -------
Balto 0 0 0 272 272
Doc 25 71 156 97 349
Sally 38 88 5 101 ?
Raju 115 75 20 33 ?
Rema 49 71 18 0 ?

Winner: ??? Votes Received: ???
Total votes polled: ???


The election committee wants the output in the following tabular form:

---------------------- Election Results ----------------------

Candidate Votes
Name Region 1 Region 2 Region 3 Region 4 Total
------------ ---------- ---------- ----------- ----------- -------
Balto 0 0 0 272 272
Doc 25 71 156 97 349
Sally 38 88 5 101 ?
Raju 115 75 20 33 ?
Rema 49 71 18 0 ?

Winner: ??? Votes Received: ???
Total votes polled: ???

Version 1
Parallel Array assignment link to access the assignment. Code, compile, link, and execute a C++ program using the given input specification to produce the output specification.

Version 2
Parallel Array assignment link to access the assignment. Code, compile, link, and execute a C++ program using the given input specification to produce a sorted output specification.

I need 2 programs in C++. Version one with array input, output and version two with input, sorted output. Please help me with this assignment. Really appreciate if anybody could help with the above program.


Explanation / Answer

Function getCandidatesName void getCandidatesName(ifstream& inp, string cNames[], int noOfRows) { int i; for(i = 0; i >cNames[i]; //read candidate_name } Function sortCandidatesName • This function uses selection sort algorithm (As discussed in this chapter) to sort the array candiatesName. void sortCandidatesName(string cNames[], int noOfRows) { int i, j; int min; //selection sort for(i = 0; i